Spaces:
Running
Running
Commit History
-
Editar Links y Nodos
76f3c6e
-
You already have a functional Sankey diagram webapp built with HTML + JavaScript + D3.js.
Verified signatureNow, I want you to update and improve the existing app, not recreate it from zero. Please apply the following changes and corrections to the current implementation: ⚙️ CORE FIXES Make node dragging fully interactive When a node is dragged, all connected links must move dynamically in real-time, just like in Plotly Sankey charts. Use d3.sankeyLinkHorizontal() to recompute the link paths whenever a node moves. Update each node’s internal coordinates (d.x0, d.x1, d.y0, d.y1) during drag events. Example snippet for the drag behavior: .on("drag", function(event, d) { d.x0 = event.x; d.x1 = event.x + (d.x1 - d.x0); d.y0 = event.y; d.y1 = event.y + (d.y1 - d.y0); nodePositions[d.index] = { x: d.x0, y: d.y0 }; d3.select(this).attr("transform", `translate(${d.x0},${d.y0})`); svg.selectAll("path").attr("d", d3.sankeyLinkHorizontal()); }); Fix the “Export to CSV” button (currently broken) Replace the existing export logic with a stable version that works ac…dd4bc85 -
modifications:
Verified signature1.- diagram could be interactive? maybe it can allow to user to move the nodes or links. 2.- Add more options for example: text color, text position 3.- add option to export to csv file in this format: Source, Target, Value3ab4c02 -
it still doesnt work, live preview doesnt show the sankey diagram. make sure to update the live view every time user add a new link. maybe you can add an update button to update the live preview section.
Verified signature94c2bba -
i need some modifications:
Verified signature1.- the live preview doesnt work. it doesnt shows anything. 2.- is better to create an example so user can get a introduction about how does it work. it oculd be a simple example 3.- default value should be 1294a40e -
initial commit
Verified signature426ba7c