question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

undeprecate colorCalculator and fix the fishy code

See original GitHub issue

Although scales and accessors are bright and shiny, they don’t cover all use cases.

In particular, it’s much easier to special-case a specific value using the colorCalculator, as seen in the venture capital example. I don’t know how to create a scale that returns normal values for everything except for one exact value (undefined in this case).

I had two reasons for deprecating this method:

  1. It’s assigning to getColor, which is a horrible horrible thing for a setter to do
  2. I thought that it’s always better to use a D3 object than to write code

The second reason isn’t all that good - D3 is not supposed to be a framework that stops you from writing code! Sometimes writing a little logic is better than the best-abstracted toolkit.

The first reason can be fixed without hurting efficiency too much.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
gordonwoodhullcommented, Feb 1, 2019

Released in 3.0.11; backported to 2.2.2 for all those folks still using d3v3!

1reaction
gordonwoodhullcommented, Feb 1, 2019

More recent versions of d3-scale include .unknown() and diverging scales, which cover some of the use cases for colorCalculator. However, a function will inevitably be easier in some cases.

I’m fixing this by adding an override function _colorCalculator, and removing the horrible assignment to .getColor, as well as the deprecation warning.

Read more comments on GitHub >

github_iconTop Results From Across the Web

LED ColorCalculator | OSRAM SYLVANIA Homepage
Estimate the photometric performance of color mixing schemes. The ColorCalculator software was developed by OSRAM SYLVANIA to aid designers develop color mixing ...
Read more >
Untitled
Solomon k bright, Mtr hong kong stock code, Mr maker bottle bird, ... Big fish eating small fish, Surtido de mariscos, Free walking...
Read more >
Delicious Bookmarks - Tilde.club
This is a collection of 10562 URLs. Collected of the years using Delicious bookmark tool. As you know, the bookmark manager stopped it's...
Read more >
Untitled
Ubmc urgent care, Baobab whole foods, Mesilla park nm zip code, Hed kandi ibiza 2013 album ... 20 inch rims ford f150, Song...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found