Nic30 / d3-hwschematic

D3.js and ELK based schematic visualizer
Eclipse Public License 2.0
94 stars 13 forks source link

Using canvas instead on SVG too render #25

Open ganeshgore opened 3 years ago

ganeshgore commented 3 years ago

For bigger schematics (CRC.json) the rendering takes much longer. Do you believe using d3 canvas render instead of SVG will improve the performance?

Nic30 commented 3 years ago

Use this flag to debug what is actually taking so long: https://github.com/Nic30/d3-hwschematic/blob/master/src/d3-hwschematic.js#L65

I think that the problem was the the layout (the algorithm which resolves how wires will be routed and components placed, not the actual rendering), layout is generated by elkjs, the options have great affect on performance https://www.eclipse.org/elk/reference/options.html (I picked something default, but it can be user overriden.) (the layout can be also precomputed, if necessary, but there is problem with expandable components as each expansion state is a new graph which has to have layout resolved)