'svg:line' usually have x1, y1, x2, y2 values.
You can use some basic algebra to calculate the line equation (http://www.coolmath.com/algebra/08-lines/12-finding-equation-two-points-01)
and find the point where you want to split the line and create two new line elements.
if you want to split it half way just find the mid point x1 + x2 / 2 and y1 + y2 / 2 and create two new lines and append them to the parent and remove the current.
on click add new line from start to mid add new line from mid to end remove self
- How to split single line into multiple lines?
- How do I split labels for my donut chart to multiple lines using d3.js?
- How to export multiple html tables and multiple d3 generated graphs into a single pdf
- How do you add multiple lines to a D3JS line chart where the depedent variable data sources start at different positions along the range?
- How do i plot multiple lines in the same line graph using the D3 framework?
- How can I properly aggregate / group multiple line graphs into one overall graph with d3.js when the x-values aren't matching exactly?
- How to turn dataset into multiple different color lines in D3.JS
- How to split multiple D3 transform commands into separate statements
- How to show multiple lines in a d3 line graph?
- Loading multiple CSV in DC.js, adding a value, and concatenating the results into a single dataTable
- How to create Stacked Line Chart D3, Multiple Y Axis and common X Axis
- How to draw single Pixel lines with d3.js / SVG
- How to convert multiple d3.csv data into number?
- Split an SVG path lengthwise into multiple colours
- how can i get a label on my lines in a line graph using d3.js
- How to plot different line patterns for different lines in DC.js series chart?
- How to draw multiple item in single data iteration in D3?
- How to overcome x-axis styling problems when multiple X-axis Values with single point to load in C3 graph?
- How to add titles to multiple pie charts, while having a single legend?
- How to properly assign separate colors to different lines and line series in D3 Dimple?
- How to make a mouseover interactive line graph with multiple data series and 2 y axes?
- How to fix a display issue in a multiple line graph. The svg.append("path") is not displaying anything
- How to plot multiple lines one for each element of an array contains y values in vega spec data?
- How to get D3 Multiple Y-Axes Ticks to Line Up?
- how i can put more lines in Line Plus Bar Chart using nvd3.js?
- Grouped line chart, how to draw lines in a repeating pattern
- How to toggle lines in a line chart using a legend
- plot dots on multiple lines in line chart
- D3 Transition. Working with multiple lines on line graph and would like to transition smoothly between lines when button is pressed
More Query from same tag
- Rendering performance in d3
- D3js v4: scaleOrdinal does not have the rangePoints()
- Stopping onclick from propagating "through" other elements
- d3.js. How to exit() by value?
- Filtering Data with on click function
- Angular Directive not updating DOM on first load
- d3 remove data using exit
- In d3.js, skip append() for null data
- Glitch/disappearence of complete d3 chart
- d3js: Apply animation together on bubbles and texts
- UndefinedError: list object has no element Undefined
- D3 js ranged bar chart
- Cannot find module 'd3-selection', 'd3-shape', 'd3-scale'
- How do I make a custom axis formatter for hours & minutes in d3.js?
- using d3.scaleOrdinal troubleshooting
- D3 Pack Layout symmetry got changed in version greater than v4.5
- Plotting of Network Topology graph based on json input
- Assign Typescript type in switch statement
- d3 wait for n second per iteration
- D3 Show Reel is not working in my html, charts are not showing
- Added image to DOM element in d3 but now it won't transition
- Line Plus Bar Chart - Is there any way to pass date as string without formatting?
- Zooming in using D3
- Hierarchical Edge Cluster Group Name
- How to select parent of directive with D3.select?