0

I've got the following code with Latex smartdiagram package that produces the attached bubble diagram.

But I would like to be able to have child satellites in it (see prototype image below).

  • Is it possible to do so with smartdiagram? If not, how could I replicate this directly with tikz or or similar?

Thanks!

\documentclass[a4paper]{article}
\usepackage{smartdiagram}
\begin{document}

\smartdiagramset{
    bubble center node font = \footnotesize,
    bubble node font = \footnotesize,
    % specifies the minimum size of the bubble center node
    bubble center node size = 0.1cm,
    %  specifies the minimum size of the bubbles
    bubble node size = 0.9cm,
    % specifies which is the distance among the bubble center node and the other bubbles
    distance center/other bubbles = 0.5cm,
    % sets the distance from the text to the border of the bubble center node
    %distance text center bubble = 0.5cm,
}
\smartdiagram[bubble diagram]{
    \normalsize{Interest} \\ \normalsize{Areas},
    \textbf{DLTs/} \\ \textbf{Blockchain,} \\ \textbf{Web3},
    \textbf{Big/Fast Data} \\ \textbf{\& Streaming},    
    \textbf{Artificial} \\ \textbf{Intelligence},
    \textbf{Functional} \\ \textbf{Programming}
}

\end{document}

What I have vs. what I want

What I have vs. what I want

What I tried

I tried replacing the satellite Functional Programming by a new diagram, with the aim of the satellite to become a new planet, so can have more satellites (the children). But the result was a mess. I mean:

\textbf{Functional} \\ \textbf{Programming} to \smartdiagram[bubble diagram]{ ... }

3
  • 1
    Welcome. // Kindly make your code useable for us, e.g. by following these steps: tex.meta.stackexchange.com/questions/228/… . Thank you. Commented Dec 23, 2023 at 19:38
  • 2
    Using the TikZ mindmap library might be more flexible Commented Dec 23, 2023 at 19:49
  • Thank you! I finally did it with TikZ but I didn't use mindmap lib. I posted an answer. Commented Dec 24, 2023 at 2:46

3 Answers 3

2

Remake of OP answer, this time without use help of Chat-GPT. Resulted code is shorter and more clear:

\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds,
                calc,
                positioning,}

\begin{document}
    \begin{tikzpicture}[
      base/.style = {circle, draw=white, line width=1.5pt, draw opacity=1,
                     minimum size=#1, align=center, font=\bfseries},
    planet/.style = {base=32mm, fill=orange},
 satellite/.style = {base=13mm, fill=#1, fill opacity=0.7},
  satchild/.style = {base=12mm, fill=green!40, fill opacity=0.7},
                        ]
% Planet
\node (P) [planet] {Interest \\ Areas};
% Satellits
\node   [satellite=blue!30, right=-7mm of P]  {DLTs/\\ Blockchain,\\ Web3};
\node   [satellite=gray!30, above=-7mm of P]  {Big/Fast Data\\ \& Streaming};
\node   [satellite=yellow!30,left=-7mm of P] {Artificial\\ Intelligence};
\node (fp) [satellite=green,below=-7mm of P]  {Functional\\ Programming};
% Satellits children
\node   [satchild, below  left=-4mm and 0mm of fp] {Unison};
\node   [satchild, below right=-4mm and 0mm of fp] {ZIO,\\ Kyo};
\node   [satchild, below=-4mm of fp] {Effect,\\ systems};
    \end{tikzpicture}
\end{document}

enter image description here

From question, is not clear, if image should have own black background. If yes you may add begore \end{tikzpicture} the following code lines:

% Background, if you like to have it in black
\scoped[on background layer]
    \draw[line width=6mm, fill] (current bounding box.south west) rectangle (current bounding box.north east);

enter image description here

1
  • code is prose for humans. Very good solution. Commented Dec 24, 2023 at 18:33
0

I finally managed to do it with TikZ with the help of Chat-GPT. Here is the result and the code for reference:

enter image description here

\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{shapes,positioning,calc}
\begin{document}
\begin{tikzpicture}

  % Define styles for the nodes
  \tikzstyle{planet}=[circle, fill=orange, minimum size=3.2cm, align=center]
  \tikzstyle{satellite}=[circle, draw, fill=green!40, minimum size=1.3cm, align=center, opacity=0.7, font=\footnotesize, postaction={draw=white, line width=1.5pt, opacity=1}]
  \tikzstyle{satchild}=[circle, draw, fill=green!25, minimum size=0.7cm, align=center, opacity=0.7, font=\footnotesize, postaction={draw=white, line width=1pt, opacity=1}]

  % Draw the central planet
  \node (interests) [planet] {Interest \\ Areas};

  \node (bigdata) [satellite, above=-0.7cm of interests, fill=gray!30] {\textbf{Big/Fast Data} \\ \textbf{\& Streaming}};
  \node (blockchain) [satellite, right=-0.7cm of interests, fill=blue!30] {\textbf{DLTs/} \\ \textbf{Blockchain,} \\ \textbf{Web3}};
  \node (fp) [satellite, below=-0.7cm of interests] {\textbf{Functional} \\ \textbf{Programming}};
  \node (ai) [satellite, left=-0.7cm of interests, fill=yellow!30] {\textbf{Artificial} \\ \textbf{Intelligence}};

  % Sat. children
  \node (unison) [satchild] at ($(fp) + (205:1.4cm)$) {Unison};
  \node (unison) [satchild] at ($(fp) + (-25:1.4cm)$) {ZIO, Kyo};
  \node (unison) [satchild, below=-4mm of fp] {Effect,\\ systems};

\end{tikzpicture}
\end{document}
2
  • Looks like you‘ve been lucky with the code generated. As a general rule I suggest to „train your brain“, not a language model. E.g. what‘s missing here is refactoring, at least for the styles, which not only increases read-ability. Commented Dec 24, 2023 at 6:15
  • Kindly have a look at ma refactoring of this ChatGPT-result, which reveals code-noise and other nasty things: tex.stackexchange.com/a/705636/245790 . Software quality can't result from noisy AI ... Commented Dec 24, 2023 at 7:47
0

Just to show the amount of code-noise generated and left by this ChatGPT-approach, here is some refactoring of the code the OP posted as a solution.

As you can see, what's left reveals some residual nastiness from the approach chosen. I.e. I'd like to refactor further, e.g. for better read-ability, but the node-statements somehow are good and bad at the same time as they are now. I.e. without much more effort it's hard to make those statements a set of easy to grasp, neatly formatted one-liners.

I also wonder, what happened to the left-to-right orientation of the original sketch, which became a bottom-to-top orientation. This may be easier to change now after refactoring than in the GPT-code posted.

I didn't dig into it, but wonder, why the postaction is really needed in the SAT and CSAT styles.

As a rule of thumb:

  • if code has an ugly look&feel, it may be wrong or hard to change
  • if code has a neatly arrangement, it's probably more correct, should it compile
  • so all these are error-preventing steps, encouraging changes as things evolve.

BTW, code-noise, e.g. bad read-ability, is less when you work backwards:

  • post nodes etc. first
  • introduce style after style
  • the code I post now is better but still not good enough from this perspective.
\documentclass[tikz,margin=2mm]{standalone}
\usetikzlibrary{positioning}

% ~~~ REFACTORING ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% --- removed unused node name ---
% --- removed bold font: not needed ----------
% --- replaced style-names for better read-ability & error prevention ----
% --- moved node names after the style statement (my convention) ---
% --- renamed node names: capitalized, shorter -----
% --- removed calc, replaced shift statements --------------
% --- removed shapes: obviously NOT needed ----------
% --- replaced 0.7cm by 7mm - grasp it at 1 glance w.o. thinking ---
% --- refactoring common styles CMN + removed not needed ones ---------
% --- same for opacity --------
% --- some, still insufficient, reformatting of code ---

\begin{document}
\begin{tikzpicture}

  % Define styles for the nodes
  \tikzstyle{CMN}   = [circle, align=center]
  \tikzstyle{OPC}   = [opacity=0.7]
  \tikzstyle{PAOPC} = [draw=white,opacity=1]
  \tikzstyle{PLANET}= [CMN, fill=orange, minimum size=3.2cm]
  \tikzstyle{SAT}   = [CMN, OPC, fill=green!40, minimum size=1.3cm,
                         font=\footnotesize, 
                         postaction={PAOPC, line width=1.5pt}]
  \tikzstyle{CSAT}  = [CMN, OPC, fill=green!25, minimum size=0.7cm,
                         font=\footnotesize, 
                         postaction={PAOPC, line width=1pt}]

  % Draw the central planet
  \node [PLANET]           (IA)      {Interest\\Areas};
  \node [SAT, above=-7mm of IA, 
        fill=gray!30]                {Big/Fast Data\\\& Streaming};
  \node [SAT, right=-7mm of IA, 
        fill=blue!30]                {DLTs/\\Blockchain,\\Web3};  
  \node [SAT, below=-7mm of IA] (FP) {Functional\\Programming};  
  \node [SAT, left=-7mm of IA, 
        fill=yellow!30]              {Artificial\\Intelligence};

  % Sat. children
  \node [CSAT]              at ([shift=(205:1.4cm)] FP) {Unison};
  \node [CSAT]              at ([shift=(-25:1.4cm)] FP) {ZIO, Kyo};
  \node [CSAT, 
         below=-4mm of FP]                      {Effect,\\systems};

\end{tikzpicture}
\end{document}

refactoredResult

2
  • 1
    \tikzset instead obsolete tikzstyle? Chat-GPT cannot yet compete with a TikZ user with some experiences (as you have) 😉. Commented Dec 24, 2023 at 7:55
  • Thank you @Zarko 😉 . // We now see some kind of core-creation, which received some "embellishment" by the algorithm, which is ok. I tend to summarize, what we also see in this case: it (AI-generated stuff) looks/sounds nice to the layman in a field, and makes a subject matter expert shaking head for a long time. // It may change, hopefully, perhaps, once knowledge can be built-in into todays AI-language models ... Commented Dec 24, 2023 at 8:40

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.