-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: fix the transpose color gradient render (#5809)
* fix: fix the gradient color render when set transpose * fix: fix the render deg * fix: add test case and snapshot --------- Co-authored-by: root <[email protected]>
- Loading branch information
Showing
8 changed files
with
3,311 additions
and
6 deletions.
There are no files selected for viewing
1,367 changes: 1,367 additions & 0 deletions
1,367
__tests__/integration/snapshots/static/temperature2LineGradientColorTranspose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,852 changes: 1,852 additions & 0 deletions
1,852
__tests__/integration/snapshots/static/temperatures3AreaBandGradientTranspose.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
__tests__/plots/static/temperature2-line-gradient-color-transpose.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { G2Spec } from '../../../src'; | ||
|
||
export function temperature2LineGradientColorTranspose(): G2Spec { | ||
return { | ||
type: 'line', | ||
height: 1000, | ||
data: { | ||
type: 'fetch', | ||
value: 'data/temperatures2.csv', | ||
}, | ||
scale: { | ||
y: { nice: true }, | ||
x: { utc: true }, | ||
color: { palette: 'turbo' }, | ||
}, | ||
legend: false, | ||
coordinate: { transform: [{ type: 'transpose' }] }, | ||
encode: { | ||
x: 'date', | ||
y: 'value', | ||
shape: 'hvh', | ||
color: 'value', | ||
series: () => undefined, | ||
}, | ||
style: { | ||
gradient: 'y', | ||
lineWidth: 2, | ||
lineJoin: 'round', | ||
}, | ||
}; | ||
} |
27 changes: 27 additions & 0 deletions
27
__tests__/plots/static/temperatures3-area-band-gradient-transpose.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { G2Spec } from '../../../src'; | ||
|
||
export function temperatures3AreaBandGradientTranspose(): G2Spec { | ||
return { | ||
type: 'area', | ||
height: 900, | ||
data: { | ||
type: 'fetch', | ||
value: 'data/temperatures3.csv', | ||
}, | ||
scale: { | ||
color: { palette: 'reds' }, | ||
}, | ||
coordinate: { transform: [{ type: 'transpose' }] }, | ||
legend: false, | ||
encode: { | ||
x: 'date', | ||
y: ['low', 'high'], | ||
shape: 'hvh', | ||
color: (d) => d.high - d.low, | ||
series: () => undefined, | ||
}, | ||
style: { | ||
gradient: 'x', | ||
}, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters