Coder Social home page Coder Social logo

charts's People

Contributors

jfmengels avatar ralfnorthman avatar terezka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

charts's Issues

Dependencies

In the elm.json file I would expect the "elm-explorations/test": "1.2.2 <= v < 2.0.0",to be in the test-dependencies?

{
    "type": "package",
    "name": "terezka/charts",
    "summary": "SVG charts components in Elm.",
    "license": "BSD-3-Clause",
    "version": "17.0.0",
    "exposed-modules": [
        "Chart.Attributes",
        "Chart.Events",
        "Chart.Item",
        "Chart.Svg",
        "Chart"
    ],
    "elm-version": "0.19.0 <= v < 0.20.0",
    "dependencies": {
        "debois/elm-dom": "1.3.0 <= v < 2.0.0",
        "elm/core": "1.0.0 <= v < 2.0.0",
        "elm/html": "1.0.0 <= v < 2.0.0",
        "elm/json": "1.0.0 <= v < 2.0.0",
        "elm/regex": "1.0.0 <= v < 2.0.0",
        "elm/svg": "1.0.1 <= v < 2.0.0",
        "elm/time": "1.0.0 <= v < 2.0.0",
        "myrho/elm-round": "1.0.4 <= v < 2.0.0",
        "ryannhg/date-format": "2.3.0 <= v < 3.0.0",
        "terezka/intervals": "2.0.0 <= v < 3.0.0"
    },
    "test-dependencies": {
        "elm-explorations/test": "1.2.2 <= v < 2.0.0", // this line
    }
}

I tried reading the docs on elm.json but they seem to be outdated a bit ... I think that you do not want to ship the tests in a library?

elm.json

Also debois/elm-dom is no longer maintained actively.

You are using DOM in charts/src/Internal/Svg.elm and it is also imported in charts/src/Chart/Svg.elm but not used

You could get the boundingClientRect with Browser.Dom.getElement - getting the parent element would be a bit more tricky.

Tooltip optimization

My tooltips felt a bit sluggish (at least in Debug mode), so I took a quick gander at the code. It looked like a straight distance function with squareroot was used for CE.getNearest, but taking the square isn't necessary when just ordering distances and is expensive compared to just multiplying.

I could make a PR this weekend if that is of interest.

Time axis ticks trouble

This package looks really promising!

Version used: 13.0.1

I noticed something strange on my axis with ticks and labels using CA.times:

time-axis-59s

For other similar intervals it looks as expected:

reasonable-axis

Another interval gave some good clues about what is going on:

time-axis-rounding

The 07:14 label above seems to belong to a 07:14:14 value. It looks like some rounding down to the new, higher "time unit" (minute in this case) for the first value larger than the "time unit" is the culprit.

Without having looked at the source code:
A solution would be to not round the first value of any given minute or better yet: always find the nice tick positions, i.e. whole, exact time units for the "larger" unit and multiples of 5 for the "smaller" unit (for minutes and seconds).

Old `elm-explorations/test` constraint preventing upgrades in consumer projects.

Hey @terezka – ran into this today on one of my projects:

$ npx elm-test-rs tests/BillingTest.elm
Error: Failed to solve dependencies for tests to run

Caused by:
    This version of elm-test-rs only supports elm-explorations/test 2.0.0 <= v < 3.0.0, but you have version 1.2.2 in your dependencies

When I went to update the version:

$ npx elm-json install elm-explorations/[email protected]

-- NO VALID PACKAGE VERSION ----------------------------------------------------

Because terezka/charts 11.0.1 depends on elm-explorations/test 1.2.2 <= v <
2.0.0 and this project depends on elm-explorations/test 2.2.0, terezka/charts
11.0.1 is incompatible with this project.

And because this project depends on terezka/charts 11.0.1, no valid set of
package versions could be found.

I don't think this will be a blocker as I could probably vendor the entirety off terezka/charts but thought you'd want to know :)

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.