D3js

如何创建一个基于WEB的工作流编辑器

∥☆過路亽.° 提交于 2019-12-09 10:38:07
本系列文章将会说明如何使用D3.js创建一个基于WEB的,具备添加、删除、移动、复制和粘贴节点及连接线,调整布局功能的工作流编辑器。 基础知识 JavaScript + HTML + CSS基础知识 D3.js入门教程 ,一系列简单易懂的D3.js教程,分为入门和进阶两个部分。 数据可视化实战-使用D3设计交互式图表 D3.js的文档 ,必不可少的官方文档,权威但是也比较难理解。 简单的Meteor知识,推荐阅读 《Discover Meteor》 实现 主要从以下这几个方面来收集资料,实现功能: 画布,即如何把多个图形渲染在指定的位置。参考 http://bl.ocks.org/explunit/4659227 连接,如何把各个图形之前通过曲线连接起来。参考 http://bl.ocks.org/explunit/5603250 冲突检测,如何在添加图形时使图形不重叠或覆盖,参考 http://bl.ocks.org/mbostock/3231298 画笔区域选择,参考 http://bl.ocks.org/musically-ut/4747894 限定范围的图形拖动,参考 http://bl.ocks.org/mbostock/1557377 后续文章会围绕这5个方面进行说明和实现,最终实现一个简单的用于物联网工作流编辑器。 来源: oschina 链接: https://my

D3js : How to convert svg text to path?

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a D3.js way to convert a text element into a path element? So when I grasp the generated svg, I could keep my the texts shapes. 回答1: There is no way in JavaScript (d3 or any other tool) to access the vector path information about the shape of individual letters in system or web fonts. It's a requested feature for SVG 2, but there are no firm proposals for how it would work. The Raphael method described in the question linked by Lars Kotthoff uses a font object that has already been converted to JavaScript, using the Cufon font

d3js append div

匿名 (未验证) 提交于 2019-12-03 08:44:33
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I tried to add some popup messages next to the node but it looks like anything else then text svg and image cant be displayed with append. node.append("text") .attr("dx", 16) .attr("dy", ".0em") .text(function(d) { return d.name }); works and adds the text but i tried to add a div and its not visible, node.append("div"). Is there something i am missing here? also how can i easly get the position of node so i can transfer the attributes to another element. 回答1: You can't put HTML elements anywhere in an SVG, you need to enclose them in a

How to change line color in d3js according to axis value?

匿名 (未验证) 提交于 2019-12-03 03:03:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to change color for this line chart if X > 100 I want it to turn "red" Is there a way I can use condition within stroke color style based on value of X ? http://jsfiddle.net/iamjeannie/b445svob/1/ enter link description here var lineData = [ { "x": 1, "y": 5}, { "x": 20, "y": 20}, { "x": 40, "y": 10}, { "x": 60, "y": 40}, { "x": 80, "y": 5}, { "x": 100, "y": 60}, { "x": 120, "y": 15}, { "x": 140, "y": 40}, { "x": 160, "y": 25}, { "x": 180, "y": 20}, { "x": 200, "y": 15}, { "x": 220, "y": 80}, { "x": 240, "y": 35}, { "x": 260, "y": 60}

Create database E-R diagram with D3js

匿名 (未验证) 提交于 2019-12-03 02:59:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I need to create an E-R diagram for a database schema using D3js. Any examples, suggestions? Thanks in advance. [EDIT] In case there is a library / utility (open source) that is more suitable for this, please so suggest. 回答1: checkout jointjs http://jointjs.com/demos/erd . I made a ER diagram with it. Also checkout https://github.com/cpettitt/dagre . You can draw directed or undirected graph using it. 文章来源: Create database E-R diagram with D3js