Using React (Hooks) with D3 - [03] Axes and Scales

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ม.ค. 2025

ความคิดเห็น • 43

  • @istvanvas8628
    @istvanvas8628 4 ปีที่แล้ว

    I don't care much about audio quality, I am here for the content of the video. This video series is awesome . Thank you

  • @_filmina3764
    @_filmina3764 4 ปีที่แล้ว +9

    I'm following through all of your videos of this series! Your explanation is so clear and simple! Looking forward to finish all your videos and create my own D3 + React hooks project soon. Thank you!

    • @muratorium
      @muratorium  4 ปีที่แล้ว

      Hey thanks! What project is that gonna be?

  • @musheerahmad6306
    @musheerahmad6306 4 ปีที่แล้ว +11

    I was searching a lot on Google about this JavaScript library with react but I was not getting anything finally i found your series, your explanation is great
    Thank you so much you should upload more videos sir like for pie chart and some more stuff

  • @adityanjsg99
    @adityanjsg99 2 ปีที่แล้ว

    A thorough series on D3 and React.. Learning a lot!

  • @kevindsouza5266
    @kevindsouza5266 4 ปีที่แล้ว +2

    u have saved me hours of time on researching d3
    and using hooks..it was the icing on the cake
    Thanks a lot!!

  • @josealuis607
    @josealuis607 2 ปีที่แล้ว

    Damm bro, you are so good explaining, thank you so much for the tutorials, you are the only one that I can understand for d3 and react and follow along, keep the good work, and I hope you are doing well, thanks again.

  • @ra9r
    @ra9r ปีที่แล้ว

    You should have introduced the concept of margins in this video. The axes are only visible because of the overflow styling. This is less than ideal. Besides that ... great content! Thank you for creating this series. Just what I was looking for. Subscribed!

  • @tslqs
    @tslqs 4 ปีที่แล้ว +1

    Yep love the new mike, and the lesson wasn't too long, it was just right. I just signed a contract with an awesome company, they do a lot of data visualization and I wanted to get familiar with d3 in the context of React. This series is exactly what I needed, thank you again for the awesome content, and you have yourself another subscriber. Cheers from Romania

  • @jeremypidjot9577
    @jeremypidjot9577 5 ปีที่แล้ว +1

    The quality of your microphone is very good now. Thank you for the explanations.

  • @briemens
    @briemens 5 ปีที่แล้ว +2

    Thanks for this great series! Incredibly helpful.
    After watching this video I was wondering how would you implement a gradient fill in a line chart and add tool tips.
    Edit: I now see part 5 addresses tooltips

  • @mohiths2065
    @mohiths2065 4 ปีที่แล้ว

    Great content! Just what I needed. Thanks :)

  • @Diaz1385
    @Diaz1385 3 ปีที่แล้ว

    Good work! Thank you so much!

  • @arr8941
    @arr8941 5 ปีที่แล้ว

    Loving this series, have you ever done anything with maps or globes ?

  • @ignaciohenriquez8739
    @ignaciohenriquez8739 3 ปีที่แล้ว

    Very good way of explaining. Why don't you have more courses or videos? do you have some on udemy or some other platform?

  • @serge65
    @serge65 4 ปีที่แล้ว

    Great content! Enjoying every single bit of this down to earth explanation! I saw your next video with transitions in bar chart which operates on height attribute, but with line chart we create d attribute which is a string and transition() does nothing. How would you do the transition with line chart (from beginning to end of x axis)?

    • @muratorium
      @muratorium  4 ปีที่แล้ว +1

      Serge Hey thanks! For that I suggest you watch video number 10, about the animated tree chart. Transitioning path elements (d attributes) like that is a bit trickier.

  • @rajajaganathan737
    @rajajaganathan737 4 ปีที่แล้ว +1

    This awesome series!! I'm really enjoying with d3. Do you have any recommend book for learning d3 ?

  • @SonicQ1905
    @SonicQ1905 ปีที่แล้ว

    Very useful!

  • @chularansifernando5
    @chularansifernando5 4 ปีที่แล้ว +1

    Hi, I need to know how to add an area to the line chart (below the line). Thanks!

    • @muratorium
      @muratorium  4 ปีที่แล้ว

      Hey, areas work very similar to lines, check out d3.area().

    • @chularansifernando5
      @chularansifernando5 4 ปีที่แล้ว

      @@muratorium Thanks!

    • @chularansifernando5
      @chularansifernando5 4 ปีที่แล้ว

      const colorScale = scaleLinear()
      .domain([25, 50, 80])
      .range(["green", "orange", "red"])
      .clamp(true);
      svg
      .selectAll(".area")
      .data([data]).join("path")
      .attr("class", "area")
      .attr("d", value => myArea(value))
      .attr("fill", colorScale)
      .attr("stroke", "blue");
      Now, the area is filled with black color. But colorScale is not working. Can you suggest me any solution? From bottom to top colors should like gradient colors. Thanks!

  • @nadadito
    @nadadito 3 ปีที่แล้ว +1

    I know it was almost 2 years ago, but why ".data([data])" goes with brackets? In fact, if I use ".data(data)" i get empty items. Thanks!

  • @pabloreyes2026
    @pabloreyes2026 5 ปีที่แล้ว +1

    Thank you so much.

  • @shadymohammed3197
    @shadymohammed3197 5 ปีที่แล้ว

    Thank you for your effort!. I love your content

  • @yazidmekhtoub
    @yazidmekhtoub 4 ปีที่แล้ว +1

    My friend this is awesome work. Please let'us know how we can Support you

  • @michalborowski8957
    @michalborowski8957 4 ปีที่แล้ว +1

    great job, thank you!!!

    • @muratorium
      @muratorium  4 ปีที่แล้ว

      michal borowski thanks!

  • @ilanlevy78
    @ilanlevy78 4 ปีที่แล้ว

    Great videos!!! So helpful!

    • @muratorium
      @muratorium  4 ปีที่แล้ว

      Ilan Levy Hey Ilan, thanks!

  • @travistree
    @travistree 4 ปีที่แล้ว +1

    Where did you set the width of svg to 300? Is that a default?

    • @muratorium
      @muratorium  4 ปีที่แล้ว +2

      Yes it is. 300px width and 150px height.

  • @PadurariuDragosh
    @PadurariuDragosh 4 ปีที่แล้ว

    Hi Muratorium ! Thank you very much for your videos. I have a question regarding the javascript logic. Where can I find some details regarding the following: .y(value => yScale(value) is the same as .y(yScale) . How does Javascript know to pass value as argument in yScale function ? Thank you very much !

    • @muratorium
      @muratorium  4 ปีที่แล้ว

      Hey Padurariu, thanks for asking. This is just pure JavaScript.
      Somewhere in d3, the .y() function you see here accepts an argument, which can be a function. If the argument is a function, d3 will try to call it:
      // example of y:
      const y = (argument) => {
      const internalDataFromY = "someData";
      return argument(internalDataFromY)
      }
      Because the argument is a function and called from within .y(), it doesn't matter whether you say .y(yScale) or .y(value => yScale(value)). Both are being "called" from .y(). The "value" comes from inside of the .y() function (internalDataFromY). Hope that helps.

  • @adeyemiadekorede3099
    @adeyemiadekorede3099 5 ปีที่แล้ว

    great videos keep it up

  • @moem.sultan4519
    @moem.sultan4519 4 ปีที่แล้ว

    Save my sprint. I'm working on crating a pie/donut chart and am still unsure as to how to implement the update/enter call backs. Do i write a map function to map from data array to path component after the join? Do I just place the svg element in the render or svg and G? Where do arcs fit in all of this? So many questions. The tutorial was superb subbed and liked.

    • @muratorium
      @muratorium  4 ปีที่แล้ว

      Moe M. Sultan Hey, I suggest you watch video #7 with the Gauge Chart, which is very similar to a Pie Chart. Also: Try Kanban!

  • @stefanw8203
    @stefanw8203 5 ปีที่แล้ว

    Thank you for this nice video

  • @swopnilmaharjan8630
    @swopnilmaharjan8630 ปีที่แล้ว

    so there is difference between line and path?... and now i m just getting confused like what is a path actully.. what is it actually. cause it doesnt make sence when u change svg.selectAll("path") to svg.selectAll("line") its just working fine?? like is there exact reason for that??

  • @tumblelandproduction
    @tumblelandproduction 3 ปีที่แล้ว

    How is this done in react native?

    • @muratorium
      @muratorium  3 ปีที่แล้ว

      No idea, I haven't tried react-native yet.

  • @kicsiSas
    @kicsiSas ปีที่แล้ว

    This tutorial is great, but with React 18 I'm facing a challange I can't find a solution for is the double render. When I create the Axes with useEffect I always get the axis added two times because of the mount / unmount / mount. Anyone any idea how to solve that? It is driving me crazy. I tried to use useRef but that is not good becuase if the data is updating the Scale of the axis needs to be update as well. Somebody please tell me a good solution.