Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you migrate a continuous diverging scheme to V3? #138

Closed
joewdavies opened this issue Nov 6, 2024 · 1 comment
Closed

How do you migrate a continuous diverging scheme to V3? #138

joewdavies opened this issue Nov 6, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@joewdavies
Copy link
Collaborator

Trying to migrate this:

      //style
      new ShapeColorSizeStyle({
          colorCol: 'd2011_2021',
          color: (v, r, s) => {
              const stre = sPow
              let t = 0.5
              if (s.min < 0 && v < 0) {
                  t -= stre(v / s.min, streC) / 2
              } else {
                  t += stre(v / s.max, streC) / 2
              }
              //t = 1 - t
              return interpolateRdBu(t)
          },
      }),


    //legend
        new ColorLegend({
            title: 'Change in number of inhabitants',
            ticks: 4,
            width: 290,
            colorRamp: interpolateRdBu,
            invert: false,
            fun: (t, r, s) => {
                const streI = sPowInverse
                if (t < 0.5) return s.min * streI(1 - 2 * t, streC)
                if (t > 0.5) return s.max * streI(2 * t - 1, streC)
                return 0
            },
        })

To V3 and I cant do it for the life of me!

How should it look in V3?

@joewdavies joewdavies added the documentation Improvements or additions to documentation label Nov 6, 2024
@jgaffuri
Copy link
Contributor

jgaffuri commented Nov 9, 2024

@jgaffuri jgaffuri closed this as completed Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants