forked from alibaba/BizCharts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix according to the need to load resources
- Loading branch information
hm.hm
committed
May 28, 2018
1 parent
b43c772
commit 38b76aa
Showing
21 changed files
with
191 additions
and
19 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
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/** | ||
* Geom Component | ||
*/ | ||
import '@antv/g2/lib/geom/index'; | ||
import Base from '../Base'; | ||
|
||
export default Base.generateBaseTypedComponent('Geom'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/area'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'area'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/edge'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'edge'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/heatmap'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'heatmap'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/interval'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'interval'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/line'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'line'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/path'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'path'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/point'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'point'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/polygon'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'polygon'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/schema'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'schema'); |
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 @@ | ||
/** | ||
* Line geometry Component | ||
*/ | ||
import '@antv/g2/lib/geom/venn'; | ||
import generateTypedGeom from '../generateTypedGeom'; | ||
|
||
export default generateTypedGeom('Geom', 'venn'); |
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,52 @@ | ||
import React, { Component } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import BaseComponent from '../Base'; | ||
|
||
function generateTypedGeom(name, geomType) { | ||
class TypedGeom extends BaseComponent { | ||
static contextTypes = { | ||
addElement: PropTypes.func, | ||
updateElement: PropTypes.func, | ||
deleteElement: PropTypes.func, | ||
createId: PropTypes.func, | ||
getParentInfo: PropTypes.func, | ||
getViewId: PropTypes.func, | ||
} | ||
|
||
static childContextTypes = { | ||
addElement: PropTypes.func, | ||
updateElement: PropTypes.func, | ||
deleteElement: PropTypes.func, | ||
createId: PropTypes.func, | ||
getParentInfo: PropTypes.func, | ||
getViewId: PropTypes.func, | ||
} | ||
|
||
static propTypes = { | ||
type: PropTypes.string, | ||
} | ||
|
||
static defaultProps = { | ||
type: geomType, | ||
} | ||
|
||
constructor(props) { | ||
super(props, name); | ||
} | ||
|
||
getChildContext() { | ||
return { | ||
addElement: this.context.addElement, | ||
updateElement: this.context.updateElement, | ||
deleteElement: this.context.deleteElement, | ||
createId: this.context.createId, | ||
getParentInfo: this.getParentInfo, | ||
getViewId: this.context.getViewId, | ||
}; | ||
} | ||
} | ||
|
||
return TypedGeom; | ||
} | ||
|
||
export default generateTypedGeom; |
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 @@ | ||
export Area from './Area'; | ||
export Edge from './Edge'; | ||
export Heatmap from './Heatmap'; | ||
export Line from './Line'; | ||
export Interval from './Interval'; | ||
export Path from './Path'; | ||
export Point from './Point'; | ||
export Polygon from './Polygon'; | ||
export Schema from './Schema'; | ||
export Venn from './Venn'; |
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,26 @@ | ||
import G2, { Shape, PathUtil, Animate } from '@antv/g2/lib/core'; | ||
import Util from './shared/util'; | ||
import Themes from './themes'; | ||
|
||
const BizCharts = { | ||
G2, | ||
Util, | ||
Shape, | ||
Animate, | ||
PathUtil, | ||
track(enable = false) { | ||
// for srs | ||
G2.track(enable); | ||
}, | ||
setTheme(theme) { | ||
let themeObj = theme; | ||
if (typeof theme === 'string' && Themes[theme]) { | ||
themeObj = Themes[theme]; | ||
} | ||
|
||
G2.Global.setTheme(themeObj); | ||
}, | ||
}; | ||
|
||
exports.default = BizCharts; | ||
module.exports = BizCharts; |
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