How to style a Mermaid subgraph's title? - mermaid

How to style the title in a Mermaid subgraph? I would like to make the font larger and add some blank space between the title and the first node beneath it.
I tried adding some <br/>'s after the title but that pushed the title above the boundary of the subgraph.
graph TB
subgraph someID[Some Title]
direction TB
....
end

Styling a subgraph title seem to work like this:
graph TB
subgraph ED[Every Day]
A <--> B
end
style ED color:#f66
Caveat: I'm using Microsoft Github's in-browser Mermaid markdown preview and I'm not sure to what degree their implementation is conformant.

If you are looking for styling that do not include coloring, you may try something like this:
someID:::someClass
subgraph someID[Some Title]
someItem(The subgraph title has some style)
end
classdef someClass padding-left:5em;
Reference: Mermaid classes

Unfortunately, there is no possibility to style the title at the moment (see this pull request).
Note that given how subgraph SVG tags are built up, there is no (current) way to style the title text.

Related

How to change the background color only for the part of the text in a mermaid node

I'm making a flow diagram where I need part of the text or its background to be of a different style. I tried to add style to the inside text, but it didn't work.
graph TD
B --> C{Let <span style="background-color:#ddd">me</span> think}
Is it possible? Any recommendations?
The workaround that I'm thinking of is to have two blocks of different styles/backgrounds and removing the borderline according to this https://mermaid.js.org/syntax/flowchart.html#styling-a-node
graph TB
subgraph block[" "]
C[text1]
D
style C fill:blue,stroke-width:0px
style D fill:yellow,stroke-width:0px
end```

How to Create different kinds of grid lines using D3 in the same graph

I am using D3 to generate the graph in an angular 5 project. I have a requirement to generate the graph as shown in required attachment. It has both solid and dashed grid lines in the same graph. I am not sure how I can achieve it.
Can anyone please help me to fix it ? Please find the actual and required graphs
Image 1 - Actual
Image 2 - Required
perhaps you can look at this example to add Minor ticks and Major ticks.
https://bl.ocks.org/erikvullings/41be28677574fd484b43e91413a7e45d
you can use the attribute stroke-dasharray to create dashed lines. It depends on the structure of your svg, but you can select the lines and add this attribute.
example:
d3.selectAll("g.tick line").attr("stroke-dasharray", "5 5")

How can I apply a Top-to-Bottom layout on a Visio flowchart?

I understand that I can use the following code to layout shapes and links in Visio:
VISIO.ActivePage.PageSheet.Layout()
This will lay it out in the standard arrangement. I want it to layout such that it is in top-to-bottom arrangement (Where the flowchart would start at the bottom and go down). Any idea how?
Try this:
Visio.ActiveWindow.Page.PageSheet.CellsSRC(visSectionObject, visRowPageLayout, visPLOPlaceStyle).FormulaForceU = "1"
Visio.ActiveWindow.Page.Layout

add brush capability in d3 line chart

I am editing with the latest code which is available in the fiddle
http://fiddle.jshell.net/nj11eruq/10/
I have reached the last leg. Now i could brush the graph and the graph gets redrawn for the selected area. I can zoom in to a detail level. However i need to reset the graph when i double click/ click the graph (no resizing brush). I am missing something here.
finally, found out the way to implement the same. (of course some more optimizations,validations expected)
http://fiddle.jshell.net/nj11eruq/12

Attach label to edge in graphviz when many labels are available

Consider the following edge in graphviz
a -> b [weight=5, foo="Ding", bar="Dong", label="something"];
Now by default, something is printed on edge when I convert this file to graph image using dot command. How can I change it to Dong without replacing bar with label?
Not possible unless you post-process.
E.g., you could output an svg file, add the foo and bar variables to a the edge href attribute, and then replace the label text automatically with, for example, javascript.

Resources