Skip to content

Commit

Permalink
Added link to possible solution on how to style svg images (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
TiboStr committed Aug 8, 2022
1 parent 941baa3 commit 7fb1bbb
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/components/node/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import {KEY_VALUES, NODE} from "../../lib/configParsing";
import {getShape} from "./nodeUtil";


import cylinder from "../../assets/cylinder.svg"

export default memo(({data, isConnectable}) => {

let width = data[KEY_VALUES[NODE].WIDTH.id];
Expand All @@ -17,13 +15,21 @@ export default memo(({data, isConnectable}) => {

let element = getShape(data[KEY_VALUES[NODE].SHAPE.id], data[KEY_VALUES[NODE].FILL.id], data[KEY_VALUES[NODE].STROKE.id], data[KEY_VALUES[NODE].STROKE_WIDTH.id]);


return (
<>


{/*
Maybe this is a solution: https://codepen.io/alvarotrigo/pen/popwJKy
{
["cylinder"].map(e => {
(document.getElementById("cylinder").style.fill = "yellow")
if (document.getElementById("cylinder")) {
(document.getElementById("cylinder").style.fill = "yellow")
}
console.log(document.getElementById("cylinder"))
return (
<svg style={{width: 50, height: 50}}>
Expand All @@ -34,7 +40,7 @@ export default memo(({data, isConnectable}) => {
})
}

/*}
{/*
https://www.geeksforgeeks.org/how-to-import-a-svg-file-in-javascript/
Expand Down

0 comments on commit 7fb1bbb

Please sign in to comment.