keplergl / kepler.gl

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
http://kepler.gl
MIT License
10.41k stars 1.74k forks source link

access "Color based on" property #2002

Open gauravgrass opened 2 years ago

gauravgrass commented 2 years ago

I want to use kepler.gl "Color based on" property in "Color" pallet in my project i tried to access it using my config file and tried to search it through kepler's docs but i am unable to find anything!

can i get any help on this?

my config file

// eslint-disable-next-line import/prefer-default-export
export const hexLayerConfig1 = {
  type: 'hexagonId',
  config: {
    dataId: 'Flight_data',
    label: 'fligts',
    color: [100, 146, 255],
    columns: {
      hex_id: 'hexagon_id'
    },
    isVisible: true,
    visConfig: {
      opacity: 0.05,
      worldUnitSize: 0.8,
      resolution: 8,
      colorRange: {
        name: 'ColorBrewer GnBu-6',
        type: 'sequential',
        category: 'ColorBrewer',
        colors: ['#f0f9e8', '#ccebc5', '#a8ddb5', '#7bccc4', '#43a2ca', '#0868ac'],
        reversed: false
      },
      coverage: 0.99,
      sizeRange: [0, 500],
      percentile: [0, 100],
      elevationPercentile: [0, 100],
      elevationScale: 5,
      'hi-precision': false,
      colorAggregation: 'average',
      sizeAggregation: 'average',
      enable3d: false
    }
  },
  visualChannels: {
    colorField: null,
    colorScale: 'quantile',
    sizeField: null,
    sizeScale: 'linear'
  }
};
SelbyLinux commented 1 year ago

hi @gauravgrass , did you set the 'color based on' successfully? i met the same problem, even i use the exported config and set the 'colorField' with { "name": "value", "type": "integer" }