-
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.
* feat: add auto mark * fix: update auto mark * fix: ci * feat: remove autolib from stdlib * fix(ci): build --------- Co-authored-by: xuxinyue.xxy <xuxinyue.xxy@antgroup.com> Co-authored-by: MiniPear <pearminipro@gmail.com>
- Loading branch information
1 parent
dbbedfe
commit 01c52a6
Showing
13 changed files
with
71 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { G2Spec } from '../../../src'; | ||
import { Auto } from '../../../src/mark/auto'; | ||
|
||
export function AutoMark(): G2Spec { | ||
return { | ||
type: Auto, | ||
data: { | ||
type: 'fetch', | ||
value: 'data/alphabet.csv', | ||
}, | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { autolib } from '../../../src/lib'; | ||
import { Auto } from '../../../src/mark'; | ||
|
||
describe('autolib', () => { | ||
it('autolib() should returns expected autolib components.', () => { | ||
expect(autolib()).toEqual({ | ||
'mark.auto': Auto, | ||
}); | ||
}); | ||
}); |
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
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { Auto } from '../mark/auto'; | ||
|
||
export function autolib() { | ||
return { | ||
'mark.auto': Auto, | ||
} as const; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Advisor } from '@antv/ava'; | ||
import { deepMix } from '@antv/util'; | ||
|
||
export const Auto = (options) => { | ||
const chartAdvisor = new Advisor(); | ||
const { | ||
data, | ||
dataProps, | ||
fields, | ||
options: o, | ||
colorOptions, | ||
...rest | ||
} = options; | ||
const results = chartAdvisor.advise({ | ||
data, | ||
dataProps, | ||
fields, | ||
options: o, | ||
colorOptions, | ||
}); | ||
return deepMix({}, rest, results?.[0].spec); | ||
}; |
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