Coder Social home page Coder Social logo

Comments (5)

sfairgrieve avatar sfairgrieve commented on May 12, 2024

Good question. I haven't tried something like that before. Let me see if I can throw an example together that works. If I can't get it to work, I'll see what I can do about updating the codebase to make it work.

from leaflet-dvf.

sfairgrieve avatar sfairgrieve commented on May 12, 2024

Here's a somewhat hacky example: http://humangeo.github.io/leaflet-dvf/examples/html/sochistats2.html. The other option would be extend one of the chart data layers (e.g. L.BarChartDataLayer) and override the _getMarker method. There you could update the options.chartOptions being passed to the L.BarChartMarker constructor to use the correct color based on value. That would probably be a better approach than the approach I'm using in the example above. Let me know if you have any questions about either approach. I'll think about updating chart data layers to make this easier in the future - appreciate any suggestions you might have.

from leaflet-dvf.

rickj33 avatar rickj33 commented on May 12, 2024

I needed the same functionality, So i started to extend the L.BarchartDataLayer and override the _getMarkerMethod, but there is an issue. In the L.ChartDatalyer and L.BarChartDataLayer the _getMarkerMethod override removes the record parameter. In the ChartDataLayer the _getLayer method calls the _getMarkerMethod but with out the record parameter even though the record object is passed into the _getLayer Method..
It would be very helpful to add the record parameter back into the _getMarkerMethod of the ChartDataLayer and BarChartDataLayer

The code i was looking at is in the 1.0Dev branch.

Thanks
Rick Jones

from leaflet-dvf.

sfairgrieve avatar sfairgrieve commented on May 12, 2024

Good point. Thanks for pointing this out. The latest code should have this change in it.

from leaflet-dvf.

rickj33 avatar rickj33 commented on May 12, 2024

Thanks for responding so quickly.

from leaflet-dvf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.