-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b64886e
commit f18179e
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
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,25 @@ | ||
{ | ||
"basis": { | ||
"type": "chart" | ||
}, | ||
"data": { | ||
"type": "json-array", | ||
"values": [ | ||
{"category": 1, "value": 4}, | ||
{"category": 2, "value": 6}, | ||
{"category": 3, "value": 10}, | ||
{"category": 4, "value": 3}, | ||
{"category": 5, "value": 7}, | ||
{"category": 6, "value": 8} | ||
] | ||
}, | ||
"layer": [ | ||
{ | ||
"mark": "arc", | ||
"encoding": { | ||
"theta": {"field": "value", "type": "quantitative"}, | ||
"color": {"field": "category", "type": "nominal", "scale": { "range": ["#5c0011", "#874d00", "#ffec3d", "#7cb305", "#08979c", "#003a8c"]}} | ||
} | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
import { EType } from './type'; | ||
import { Aggregate } from './aggregate'; | ||
import { Scale } from './scale'; | ||
|
||
export interface Color { | ||
field: string; | ||
type: EType; | ||
aggregate?: Aggregate; | ||
scale?: Scale; | ||
} |
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,13 @@ | ||
// TODO: detailed type denifition. currently to support color hex string | ||
export type Scale = { | ||
// range after data mapping | ||
// such as ['apple', 'banana'] --map to--> ['red', 'yellow'](range) | ||
range: (string | number)[]; | ||
rangeMin: string | number; | ||
rangeMax: string | number; | ||
// data domain used to data mapping | ||
// such as [0, 100] --domain:[10, 90]--> [10, 90](filter data less than 10) | ||
domain: number[]; | ||
domainMin: number; | ||
domaminMax: number; | ||
}; |