Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    @csisk130_gitlab why not make one yourself for now until official one comes out?
    https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3/v4
    Ghost
    @ghost~5c363bf4d73408ce4fb42605

    @csisk130_gitlab https://github.com/DefinitelyTyped/DefinitelyTyped#how-can-i-contribute

    Have you tested to see if the current type works for v6 or not?

    Kevin M Granger
    @KevinMGranger
    I'm looking through the d3-zoom docs and some examples on observable-- I keep seeing .on("zoom", zoomed), but I can't find where zoomed is defined, in either d3 or observable's standard library. Clicking it to go to its definition doesn't work either. What is it?
    Kevin M Granger
    @KevinMGranger
    Oh nevermind, I see it in one of the examples. It's weird that the docs reference it but don't really show it, though.
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    @KevinMGranger yep
    tobwen
    @tobwen
    Hmm, does anyone know a working example to export D3 charts to SVG? It's fine to run it offline. Right now, I'm using a headless chrome to render my charts into PDF. Then I'm running a batch process to convert the PDF to SVG using Inkscape. I know many guys running this toolchain - but it's awful.
    Ian Johnson
    @enjalot
    @tobwen presumably your charts are being rendered in SVG, if you're using headless chrome you could save the svg directly, it looks like this article has code snippets for that: https://intoli.com/blog/saving-images/
    also, this chrome extension helps download svg generated by d3: https://nytimes.github.io/svg-crowbar/ i don't know how hard it would be to adapt its code to work on headless chrome
    tobwen
    @tobwen
    @enjalot Thanks for the hint. I'm already using Puppeteer - it's a great tool. After some hours of trying, I got some working code for my D3 charts. All those bookmarklets didn't work for me. The main reason for this was: missing CSS styles. I've written a small tool in PHP, which scans all the elements for the styles used. I'll add them to XML/SVG definitions then. I think of porting it to Javascript and upload it to Github. Might take a while, since I'm not into "modern" JS :-)
    tobwen
    @tobwen
    Anyone in here who can help me with a labeling problem? The labels of my line charts always intersect with the line. Of course, a working solution will be paid and you can release the result as open-source or use it for 3rd parties.
    Ian Johnson
    @enjalot
    tobwen
    @tobwen

    @tobwen have you seen https://observablehq.com/@harrystevens/directly-labelling-lines

    Thanks. I know this concept from cartography. Perhaps I can get it to work in my charts.

    tobwen
    @tobwen
    image.png
    @enjalot But I don't think this will help me with my problem :-(
    captproton
    @captproton
    hi
    Ghost
    @ghost~5fc3a438d73408ce4ff53b1a
    Hello
    Mark Hughes (happybeing/theWebalyst)
    @happybeing
    Not much activity here, much better on the d3 slack: https://app.slack.com/client/T07ET41GS/C07ET41MG/thread/CRZBL735G-1600445243.005400 I think this is the invite link: https://d3-slackin.herokuapp.com/
    Osman Zakir
    @DragonOsman
    I need some help with a D3js project for Free Code Camp. My code: https://codepen.io/DragonOsman/pen/ExgxXYo . The specs: https://www.freecodecamp.org/learn/data-visualization/data-visualization-projects/visualize-data-with-a-bar-chart . I need help with getting the bars' x values and heights right. I'm stuck. What am I doing wrong?
    Osman Zakir
    @DragonOsman
    In the code I linked to above, I probably wrote yScale and xScale wrong due to which writing (i * 25) (bar width plus 5 to leave some gap between the bars) and yScale(d[1]) doesn't work correctly. I need some help in figuring out what I did wrong there. Thanks in advance.
    Fil
    @fil:matrix.org
    [m]
    This channel is now living both in gitter and matrix.
    1 reply
    guanw
    @guanw
    Hi, I have a question regarding getBbox method. It seems if I select multiple svg elements and do a selection.node().getBbox() on them the bounding box returned is only gonna be for a single element, can anyone confirm if my understanding correct here? (In other words, one has to come up with his/her own algo to compute composite bounding box)
    Ghost
    @ghost~57372079c43b8c601972e40c
    selection is iterable so you can probably do something like for (const node of selection) { node.getBBox()… }
    guanw
    @guanw

    selection is iterable so you can probably do something like for (const node of selection) { node.getBBox()… }

    sure so it's expected for .node().getBbox() to return single element even multiple are selected?

    Fil
    @fil:matrix.org
    [m]
    yes node() returns the first node
    selection.nodes() returns all nodes
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    Greetings, trying to create a custom powerbi heat map, leveraging d3. Anyone has ever dabbled in this? Thanks
    Artiom Neganov
    @OnkelTem
    Has anyone ever tried to use the TypeScript version of the library? I have been struggling to a get a simple graph and it doesn't seem to be possible. Did anyone check it? The types.
    Say, the join() is defined a way so that it cannot return SVGGElement even if you pass it: join('g').
    As the result, it cannot be further seeded to a mere axis builder, as the latter wants either SVG or G element
    Ghost
    @ghost~5c363bf4d73408ce4fb42605
    You might to post that @OnkelTem on d3 slack channel
    David Pineda
    @pineiden_gitlab
    @OnkelTem Not yet, but i take a typescript course ad you have to have an extra file from normal js libraries with the types.... i dont remember, other way is search for d3+types
    David Pineda
    @pineiden_gitlab
    Tanner Stirrat
    @tstirrat15
    is there a best practice for using d3 with es6 imports? it seems like import d3 from 'd3' or import * as d3 from 'd3' is discouraged, and i saw something about doing Object.assign({}, list, of, imports) but that seems janky
    do most d3 packages assume that they're being called from some d3 master object and therefore require this (i.e. they aren't pure functions)?
    Artiom Neganov
    @OnkelTem
    HI all
    How to extend d3 with additional functions? For example there is .attr() function on selection but I want to add mine
    e.g. attrs()
    Ahmad R
    @harvester-klirk
    Hi everybody ! , i've got a quick question please , i'm using topojson file to plot a d3 map is there anyway of how to make some countries ( or states ) bigger in the area ?
    at-webdev
    @at-webdev
    Hello All! I am trying to update data regularly with join().What is the best approach to plot data, without re-drawing x-axis as in my case, x-axis would remain the same after data updates. Is that possible with d3?
    Kane-yang
    @Kane-yang
    hello
    martinv678
    @martinv678
    Anyone had issues with transform-origin when resizing a div using d3?
    fjl1016926478
    @fjl1016926478
    I am using the D3.js tree diagram to draw the tree diagram, but when the tree diagram reaches 10,000 nodes, dragging and moving will be more lagging. Is there any solution for this?
    StillLearning
    @amitmadahar
    You can implement data fetch on demand. See d3-fetch library here: D3-Fetch
    Another example here: Stackoverflow
    fjl1016926478
    @fjl1016926478
    @amitmadahar My current scenario is that I need to load all the data at once, and then I need to drag the tree diagram to view it a little bit. At this time, all nodes are loaded at one time, and the tree diagram will be stuck when dragging.
    StillLearning
    @amitmadahar
    @fjl1016926478 hmmmm.... a tough one for me at least. I thought you would be looking at the a sub-domain of the data and not 10,000lines at once, hence suggested to sequentially load the data.
    Or may be ever reconsider changing the workflow, I have not seen the data but seems difficult to imagine that user would be looking at 10,000 datapoints all at once.... you could experiment with delayed loading of data but if you want all datapoints to be loaded sooner or later....memory and CPU requirement would make you face the same issues....sooner or later.
    manjuke
    @manjuke
    HI All,
    I have developed a software utility using d3.js library... I would like to apply for copyright for the utility that I have developed
    Is it legal? Will it violate licensing or any other terms of d3.js...
    1 reply
    Is is valid & correct? .. Please suggest... Thanks