Is d3 a good choice for building a free-form diagram editor? [closed]
Asked Answered
B

2

7

I am planning on writing a web-based diagram editor. If it were for the desktop, I'd have chosen Eclipse GEF as the platform to build it.

For the web, I'm considering d3.js, but I'm a bit worried that almost every example and article that I came across on d3 was for visualizing data, and not really for an interactive point-and-click, select-and-connect, drag-and-draw kind of usage.

I might still be able to force-fit d3 into the making of this editor, but then I wonder if d3 would evolve in ways that would make it continually painful to maintain the editor going forward.

So my question to the community is: from a software architecture standpoint, is d3 a good choice for building a free-form diagram editor? Can you pont me to API, d3 internal code, articles, or examples that would prove that such an editor can stand in the long term?

Bad answered 11/6, 2013 at 16:35 Comment(2)
This calls for opinion, so voting to close.Fattal
Edited to make it less of an open-ended opinion-soliciting question to one that can be "answered" in an unambiguious way.Bad
C
13

If the question were "Can D3 help me with the SVG interactions involved in creating a web-based diagram editor?", then the answer would be "Yes, a little". But you're setting out on a very large project, and D3 can only help you with some parts of it.

Examples of areas where D3 can be of assistance:

Overall I think you're probably looking for a higher-level framework unless you are prepared to control almost every aspect of what D3 does.

You are right that most of the helper methods that D3 provides are geared toward data visualization, but it does provide a thin layer over SVG that can be helpful for a general-purpose project like you describe.

As to whether D3 will evolve in a direction that might make it less suitable for this project in the future: only @mbostock can know for sure, but given the design of the API which lets it be used for either SVG or HTML node manipulation, I think it's safe to say that it will remain fairly low level. And you've probably seen this example before but it's a good illustration of the library's power beyond charts & graphs.

Centaur answered 11/6, 2013 at 19:13 Comment(0)
M
2

D3 is "just" a framework, and as such can be used for almost anything. It does sound however like it wouldn't be a particularly good fit for what you are trying to do. In particular, it doesn't sound like D3's main concept -- that everything is driven by the data -- would be beneficial here.

Mezzo answered 11/6, 2013 at 16:59 Comment(1)
Agree overall, but wouldn't completely discount the "everything is driven by the data" approach. You have to render the existing diagrams somehow, and they are data (nodes, shapes, connections, etc)Centaur

© 2022 - 2024 — McMap. All rights reserved.