Commit f57105d0 authored by alain's avatar alain 🐙
Browse files

different color interpolation

parent 035fcc4a
......@@ -6,7 +6,8 @@ import { getColor, getColorArray } from "../util/color.js"
import { setMetersOffset } from "../util/plot"
import { mapControlSettings, mapItemSettings, lightSettings } from "../../../config/map"
//lightSettings
import { mapControlSettings, mapItemSettings } from "../../../config/map"
......@@ -74,7 +75,7 @@ class StationLayer extends CompositeLayer {
radius,
diskResolution: sides,
opacity: 0.95,
lightSettings,
//lightSettings,
getElevation: d => getHeight(d.mean, zoom),
getPosition: d => this.getCoordinates(d, count, radius),
getFillColor: d => {
......
import { rgb, hsl } from "d3-color"
import { scaleLinear, scaleLog } from "d3-scale"
import { interpolateCubehelix } from "d3-interpolate"
import {
interpolate,
//interpolateCubehelix
} from "d3-interpolate"
......@@ -9,7 +12,9 @@ export const getColor = (value, legend, log = false) => {
const domain = Object.keys(legend).sort((a,b) => a-b)
const range = domain.map(k => legend[k].color)
const scale = log ? scaleLog().domain(domain).interpolate(interpolateCubehelix.gamma(0.5)).range(range) : scaleLinear().domain(domain).interpolate(interpolateCubehelix.gamma(0.5)).range(range)
const scale = log ? scaleLog() : scaleLinear()
//scale.domain(domain).interpolate(interpolateCubehelix.gamma(0.5)).range(range)
scale.domain(domain).interpolate(interpolate).range(range)
return scale(value)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment