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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts] Add z-axis to colorize scatter charts #12738

Merged
merged 11 commits into from
Apr 19, 2024
34 changes: 19 additions & 15 deletions docs/data/charts/bars/ColorScaleNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,55 +112,59 @@ export default function ColorScaleNoSnap() {
...(colorX === 'None' ? [' xAxis={[{}]}'] : []),
...(colorX === 'ordinal'
? [
' xAxis={[',
` {`,
' xAxis={[{',
` colorMap: {`,
` type: 'ordinal',`,
` colors: ['#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#08589e']`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorX === 'continuous'
? [
' xAxis={[',
` {`,
' xAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: new Date(2019, 1, 1),`,
` max: new Date(2024, 1, 1),`,
` color: ['green', 'orange']`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorX === 'piecewise'
? [
' xAxis={[{',
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` }`,
' }]}',
]
: []),
// ColorY
...(colorY === 'None' ? [' yAxis={[{}]}'] : []),
...(colorY === 'continuous'
? [
' yAxis={[',
` {`,
' yAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: -10,`,
` max: 10,`,
` color: ['red', 'green'],`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorY === 'piecewise'
? [
' yAxis={[{',
` type: 'piecewise',`,
` thresholds: [0],`,
` colors: ['red', 'green'],`,
` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [0],`,
` colors: ['red', 'green'],`,
` }`,
' }]}',
]
: []),
Expand Down
36 changes: 19 additions & 17 deletions docs/data/charts/bars/ColorScaleNoSnap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,32 +122,34 @@ export default function ColorScaleNoSnap() {
...(colorX === 'None' ? [' xAxis={[{}]}'] : []),
...(colorX === 'ordinal'
? [
' xAxis={[',
` {`,
' xAxis={[{',
` colorMap: {`,
` type: 'ordinal',`,
` colors: ['#ccebc5', '#a8ddb5', '#7bccc4', '#4eb3d3', '#2b8cbe', '#08589e']`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorX === 'continuous'
? [
' xAxis={[',
` {`,
' xAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: new Date(2019, 1, 1),`,
` max: new Date(2024, 1, 1),`,
` color: ['green', 'orange']`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorX === 'piecewise'
? [
' xAxis={[{',
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` }`,
' }]}',
]
: []),
Expand All @@ -156,24 +158,24 @@ export default function ColorScaleNoSnap() {
...(colorY === 'None' ? [' yAxis={[{}]}'] : []),
...(colorY === 'continuous'
? [
' yAxis={[',
` {`,

' yAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: -10,`,
` max: 10,`,
` color: ['red', 'green'],`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorY === 'piecewise'
? [
' yAxis={[{',
` type: 'piecewise',`,
` thresholds: [0],`,
` colors: ['red', 'green'],`,

` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [0],`,
` colors: ['red', 'green'],`,
` }`,
' }]}',
]
: []),
Expand Down
28 changes: 16 additions & 12 deletions docs/data/charts/lines/ColorScaleNoSnap.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,45 +103,49 @@ export default function ColorScaleNoSnap() {
...(colorX === 'None' ? [' xAxis={[{}]}'] : []),
...(colorX === 'continuous'
? [
' xAxis={[',
` {`,
' xAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: new Date(2019, 1, 1),`,
` max: new Date(2024, 1, 1),`,
` color: ['green', 'orange']`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorX === 'piecewise'
? [
' xAxis={[{',
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` }`,
' }]}',
]
: []),
// ColorY
...(colorY === 'None' ? [' yAxis={[{}]}'] : []),
...(colorY === 'continuous'
? [
' yAxis={[',
` {`,
' yAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: -10,`,
` max: 10,`,
` color: ['red', 'green'],`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorY === 'piecewise'
? [
' yAxis={[{',
` type: 'piecewise',`,
` thresholds: [0, 10],`,
` colors: ['red', 'green', 'blue'],`,
` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [0, 10],`,
` colors: ['red', 'green', 'blue'],`,
` }`,
' }]}',
]
: []),
Expand Down
29 changes: 16 additions & 13 deletions docs/data/charts/lines/ColorScaleNoSnap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,24 @@ export default function ColorScaleNoSnap() {
...(colorX === 'None' ? [' xAxis={[{}]}'] : []),
...(colorX === 'continuous'
? [
' xAxis={[',
` {`,
' xAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: new Date(2019, 1, 1),`,
` max: new Date(2024, 1, 1),`,
` color: ['green', 'orange']`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorX === 'piecewise'
? [
' xAxis={[{',
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [new Date(2021, 1, 1), new Date(2023, 1, 1)],`,
` colors: ['blue', 'red', 'blue'],`,
` }`,
' }]}',
]
: []),
Expand All @@ -135,23 +137,24 @@ export default function ColorScaleNoSnap() {
...(colorY === 'None' ? [' yAxis={[{}]}'] : []),
...(colorY === 'continuous'
? [
' yAxis={[',
` {`,
' yAxis={[{',
` colorMap: {`,
` type: 'continuous',`,
` min: -10,`,
` max: 10,`,
` color: ['red', 'green'],`,
` }`,
' ]}',
' }]}',
]
: []),
...(colorY === 'piecewise'
? [
' yAxis={[{',
` type: 'piecewise',`,
` thresholds: [0, 10],`,
` colors: ['red', 'green', 'blue'],`,

` colorMap: {`,
` type: 'piecewise',`,
` thresholds: [0, 10],`,
` colors: ['red', 'green', 'blue'],`,
` }`,
' }]}',
]
: []),
Expand Down