-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shapes: see if different SVG importing structure is possible #29
Comments
You make perfect sense by saying "why not put these svgs as actual files and import them?" dataflow-visualization/src/custom/node/nodeUtil.js Lines 6 to 144 in 761e128
But then how am I supposed to import them and style them? This is my best try: dataflow-visualization/src/custom/node/Node.js Lines 24 to 37 in 761e128
The image is visible, but I can't style them (even if I go into cylinder.svg and remove |
Normally you can style svg's by using CSS, so eg add classes to the svg element and edit the css instead of doing inline styles https://www.w3.org/TR/SVG11/styling.html#ClassAttribute |
Do you mean give every node an id and change the CSS with results in: Doing it this way is no different than doing it inline and it doesn't even work. |
nono, I would expect to dynamically set the CSS (see e.g. https://codepen.io/alvarotrigo/pen/popwJKy), but maybe that's also not a good idea |
I don't think that's a good idea either. Because then my stylesheet would look like this?: .green-fill {
fill: green;
}
.red-fill {
fill: red;
}
.royalblue-fill {
fill: royalblue;
}
.whitesmoke-fill {
fill: whitesmoke;
}
...
.stroke-width-1 {
stroke-width: 1;
}
.stroke-width-2 {
stroke-width: 2;
}
...
.stroke-green {
stroke: green;
}
.stroke-yellow {
stroke: yellow;
}
... That doesn't seem very efficient. And I think it wouldn't even work, I think the only way to change color is using filter. But then you still have the problem of changing e.g. |
Ah no, I'd make your stylesheet as follows: .global-style-node {
stroke-width: 1 ;
}
.node-id-123 {
stroke-width: 2;
color: blue;
...
} But then you need to create IDs for each node and edge |
I'll experiment with this. I hope this works. |
(if it gets too difficult, feel free to move this to a separate open issue and don't overspend effort) |
Ok, I'll leave it for later. There are probably more urgent issues. Also if you paste your example into e.g. WebStorm, you'll see that some of the things used in that script are deprecated. |
fix comments of branch review/bdm
The text was updated successfully, but these errors were encountered: