Giter Club home page Giter Club logo

viser's Issues

什么时候出文档啊

没有文档,盲用啊,vue组件跟着你的demo用了还是很方便的,但是没有文档啊。

webpack 打包

相比同类型的库打包出来好大啊,有什么优化措施吗?

how to rerender v-chart in Angular?

          <v-chart #chart [forceFit]="forceFit" [height]="height" [data]="data" [dataPre]="dataPre" [scale]="scale">
            <v-tooltip></v-tooltip>
            <v-axis dataKey="item" line="null" tickLine="null" [grid]="axis1GridOpts"></v-axis>
            <v-axis dataKey="score" line="null" tickLine="null" [grid]="axis2GridOpts"></v-axis>
            <v-legend></v-legend>
            <v-coord type="polar" radius="0.8"></v-coord>
            <v-line position="item*score" color="user" size="2"></v-line>
            <v-point position="item*score" color="user" size="4"></v-point>
            <v-area position="item*score" color="user"></v-area>
          </v-chart>

change data can't render v-chart

viser-vue中 v-point 元素传入自定shape不起作用

在vue中实现带图片遮罩的词云时,自定义了shape,传入v-point中,shape没起作用

<v-point :position="'x*y'" :color="'text'" :shape="'cloud'" />

import { registerShape } from 'viser-vue';
function getTextAttrs(cfg) {
return Object.assign({}, {
fillOpacity: cfg.opacity,
fontSize: cfg.origin._origin.size,
rotate: cfg.origin._origin.rotate,
text: cfg.origin._origin.text,
textAlign: 'center',
fontFamily: cfg.origin._origin.font,
fill: cfg.color,
textBaseline: 'Alphabetic'
}, cfg.style);
}

registerShape('point', 'cloud', {
draw(cfg, container) {
const attrs = getTextAttrs(cfg);
return container.addShape('text', {
attrs: Object.assign(attrs, {
x: cfg.x,
y: cfg.y
})
});
}
});

react15下会有 ts 报错

[at-loader] ./node_modules/viser-react/src/components/Facet.tsx:5:22                                                                    │is-odd                                                  whatwg-fetch
    TS2415: Class 'Facet' incorrectly extends base class 'Component<IFacet, any>'.                                                      │is-path-cwd                                             whet.extend
  Types of property 'render' are incompatible.                                                                                          │is-path-in-cwd                                          which
    Type '() => ReactNode' is not assignable to type '() => false | Element'.                                                           │is-path-inside                                          which-module
      Type 'ReactNode' is not assignable to type 'false | Element'.                                                                     │is-plain-obj                                            wide-align
        Type 'string' is not assignable to type 'false | Element'.

React 15版本的环境下, 使用 viser, 会有上述报错.
在React 15 版本还不支持直接 return this.props.children
详细可见: https://stackoverflow.com/questions/39133797/react-only-return-props-children

有3处:
https://github.com/viserjs/viser/blob/master/packages/viser-react/src/components/Facet.tsx#L27
https://github.com/viserjs/viser/blob/master/packages/viser-react/src/components/FacetView.tsx#L51
https://github.com/viserjs/viser/blob/master/packages/viser-react/src/components/View.tsx#L47

Angular version fails the production build

Environment: Angular 5.0
Application: simple example like https://viserjs.github.io/demo.html#/bar/stacked-bar

Ran into this error:
$ ng build --prod
Date: 2018-01-10T01:47:26.232Z
Hash: 13c7cb86d7d449e7a853
Time: 3607ms
chunk {0} styles.9c0ad738f18adc3d19ed.bundle.css (styles) 79 bytes [initial] [rendered]
chunk {1} polyfills.3bc34265385d52184eab.bundle.js (polyfills) 86 bytes [initial] [rendered]
chunk {2} main.e402deade8b026b7d50e.bundle.js (main) 84 bytes [initial] [rendered]
chunk {3} inline.22b7623ed7c5ac6f9a35.bundle.js (inline) 1.45 kB [entry] [rendered]

ERROR in : Unexpected value 'Axis in /xxxxx/viser-app/node_modules/viser-ng/src/components/index.ts' declared by the module 'ViserModule in /xxxxx/viser-app/node_modules/viser-ng/src/module.ts'. Please add a @Pipe/@Directive/@component annotation.
node_modules/viser/src/utils/CustomizeUtils.ts(1,12): error TS2304: Cannot find name 'require'.
node_modules/viser/src/core/CommonDataSet.ts(4,17): error TS2304: Cannot find name 'require'.
node_modules/viser/src/core/CommonChart.ts(19,12): error TS2304: Cannot find name 'require'.
node_modules/viser/src/index.ts(16,12): error TS2304: Cannot find name 'require'.

”刻度仪表盘“ with angular error

When navigate to demo : https://viserjs.github.io/demo.html#/gauge/tick-gauge
The tick-gauge can not show , and the console error:

demo.js:201119 Uncaught Error: Template parse errors:
Can't bind to 'position' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'position' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
        ></v-coord>
        <v-interval
          [ERROR ->][position]="'type*value'"
          [color]="'#CBCBCB'"
          [size]="6"
"): ng:///AppModule/AppComponent.html@12:10
Can't bind to 'color' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'color' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
        <v-interval
          [position]="'type*value'"
          [ERROR ->][color]="'#CBCBCB'"
          [size]="6"
        ></v-interval>
"): ng:///AppModule/AppComponent.html@13:10
Can't bind to 'size' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'size' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
          [position]="'type*value'"
          [color]="'#CBCBCB'"
          [ERROR ->][size]="6"
        ></v-interval>
      </v-view>
"): ng:///AppModule/AppComponent.html@14:10
'v-interval' is not a known element:
1. If 'v-interval' is an Angular component, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
          [radius]="0.8"
        ></v-coord>
        [ERROR ->]<v-interval
          [position]="'type*value'"
          [color]="'#CBCBCB'"
"): ng:///AppModule/AppComponent.html@11:8
Can't bind to 'position' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'position' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
        ></v-coord>
        <v-interval
          [ERROR ->][position]="'type*value'"
          [color]="'#CBCBCB'"
          [size]="6"
"): ng:///AppModule/AppComponent.html@34:10
Can't bind to 'color' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'color' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
        <v-interval
          [position]="'type*value'"
          [ERROR ->][color]="'#CBCBCB'"
          [size]="6"
        ></v-interval>
"): ng:///AppModule/AppComponent.html@35:10
Can't bind to 'size' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'size' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
          [position]="'type*value'"
          [color]="'#CBCBCB'"
          [ERROR ->][size]="6"
        ></v-interval>
      </v-view>
"): ng:///AppModule/AppComponent.html@36:10
'v-interval' is not a known element:
1. If 'v-interval' is an Angular component, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
          [radius]="0.55"
        ></v-coord>
        [ERROR ->]<v-interval
          [position]="'type*value'"
          [color]="'#CBCBCB'"
"): ng:///AppModule/AppComponent.html@33:8
Can't bind to 'position' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'position' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
        ></v-coord>
        <v-interval
          [ERROR ->][position]="'type*value'"
          [color]="frontIntervalColor"
          [opacity]="1"
"): ng:///AppModule/AppComponent.html@48:10
Can't bind to 'color' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'color' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
        <v-interval
          [position]="'type*value'"
          [ERROR ->][color]="frontIntervalColor"
          [opacity]="1"
          [size]="6"
"): ng:///AppModule/AppComponent.html@49:10
Can't bind to 'opacity' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'opacity' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
          [position]="'type*value'"
          [color]="frontIntervalColor"
          [ERROR ->][opacity]="1"
          [size]="6"
        ></v-interval>
"): ng:///AppModule/AppComponent.html@50:10
Can't bind to 'size' since it isn't a known property of 'v-interval'.
1. If 'v-interval' is an Angular component and it has 'size' input, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message.
3. To allow any property add 'NO_ERRORS_SCHEMA' to the '@NgModule.schemas' of this component. ("
          [color]="frontIntervalColor"
          [opacity]="1"
          [ERROR ->][size]="6"
        ></v-interval>
        <v-guide
"): ng:///AppModule/AppComponent.html@51:10
'v-interval' is not a known element:
1. If 'v-interval' is an Angular component, then verify that it is part of this module.
2. If 'v-interval' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
          [radius]="0.8"
        ></v-coord>
        [ERROR ->]<v-interval
          [position]="'type*value'"
          [color]="frontIntervalColor"
"): ng:///AppModule/AppComponent.html@47:8
    at syntaxError (demo.js:201119)
    at TemplateParser.parse (demo.js:225294)
    at JitCompiler._parseTemplate (demo.js:235105)
    at JitCompiler._compileTemplate (demo.js:235080)
    at demo.js:234981
    at Set.forEach (<anonymous>)
    at JitCompiler._compileComponents (demo.js:234981)
    at demo.js:234851
    at Object.then (demo.js:201108)
    at JitCompiler._compileModuleAndComponents (demo.js:234850)
syntaxError @ demo.js:201119
TemplateParser.parse @ demo.js:225294
JitCompiler._parseTemplate @ demo.js:235105
JitCompiler._compileTemplate @ demo.js:235080
(anonymous) @ demo.js:234981
JitCompiler._compileComponents @ demo.js:234981
(anonymous) @ demo.js:234851
then @ demo.js:201108
JitCompiler._compileModuleAndComponents @ demo.js:234850
JitCompiler.compileModuleAsync @ demo.js:234744
CompilerImpl.compileModuleAsync @ demo.js:26948
PlatformRef.bootstrapModule @ demo.js:5839
Object.setPrototypeOf.__proto__ @ demo.js:172524
__webpack_require__ @ demo.js:20
webpackContext @ demo.js:154376
Demo.runCode @ demo.js:55822
Demo.renderCase @ demo.js:55844
(anonymous) @ demo.js:55899
dispatch @ demo.js:32826
elemData.handle @ demo.js:32634

在ng5下不可以懒加载,只可放在根

Error: Uncaught (in promise): Error: Cannot enable prod mode after platform setup.
Error: Cannot enable prod mode after platform setup.
at enableProdMode (core.js:5247)
at eval (module.js:96)
at Object.../../../../viser-ng/es/module.js (blog.module.chunk.js:483)
at webpack_require (inline.bundle.js:55)
at eval (index.js:2)
at Object.../../../../viser-ng/es/index.js (blog.module.chunk.js:475)
at webpack_require (inline.bundle.js:55)
at eval (blog.module.ts:12)
at Object.../../../../../src/app/views/blog/blog.module.ts (blog.module.chunk.js:89)
at webpack_require (inline.bundle.js:55)
at enableProdMode (core.js:5247)
at eval (module.js:96)
at Object.../../../../viser-ng/es/module.js (blog.module.chunk.js:483)
at webpack_require (inline.bundle.js:55)
at eval (index.js:2)
at Object.../../../../viser-ng/es/index.js (blog.module.chunk.js:475)
at webpack_require (inline.bundle.js:55)
at eval (blog.module.ts:12)
at Object.../../../../../src/app/views/blog/blog.module.ts (blog.module.chunk.js:89)
at webpack_require (inline.bundle.js:55)
at resolvePromise (zone.js:809)
at resolvePromise (zone.js:775)
at eval (zone.js:858)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4724)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at drainMicroTaskQueue (zone.js:595)
at

viser-ng 的view 一定要分开编写,与 react , vue 的存在默认view 的形式不同

react
<Chart forceFit height={400} data={averages} scale={scale}> <Tooltip /> <Axis /> <Line position="time*temperature" size="2" /> <Point position="time*temperature" size="4" style={pointStyle}/> <View viewId="2" data={data}> <Area position="time*temperature" /> </View> </Chart>

angular
<Chart [forceFit]="forceFit" [height]="height"> <View viewId="1" [data]="averages" [scale]="scale"> <Tooltip></Tooltip> <Axis></Axis> <Line position="time*temperature" size="2"></Line> <Point position="time*temperature" size="4" [style]="pointStyle"></Point> </View> <View viewId="2" [data]="data" [scale]="scale"> <Area position="time*temperature" /> </View> </Chart>
详情可见: https://viserjs.github.io/demo.html?type=area&example=4

What's the necessity of viser?

As its API is the same as G2, and what I should do is to read G2 doc, so why should I use it ?
I am using vue and in my opinion, it would just make my project more complex and hope to get your idea.
Do you mean that the tags like <v-chart> would be convenient for us?

viser-ng 的 Box标签 style属性 的 fillOpacity 属性不支持

<Chart [forceFit]="forceFit" [height]="height" >
  <View viewId="1" [data]="data" [dataPre]="dataPre" [scale]="scale">
    <Tooltip [showTitle]="tooltipOpts.showTitle" [crosshairs]="tooltipOpts.crosshairs" [itemTpl]="tooltipOpts.itemTpl"></Tooltip>
    <Axis></Axis>
    <Box position="x*range" [style]="boxStyle" [tooltip]="boxTooltip"></Box>
  </View>
  <View viewId="4" [data]="data" [scale]="scale">
    <Point [position]="'x*range'" [size]="3" [active]="false"></Point>
  </View>
</Chart>

const boxStyle = {
stroke: '#545454',
fill: '#1890FF',
fillOpacity: 0.3
};

viser-vue 的point 标签未支持style 属性

<v-chart :force-fit="true" :height="height" :data="averages" :scale="scale"> <v-tooltip /> <v-axis /> <v-line :position="'time*temperature'" :size="2" /> <v-point :position="'time*temperature'" :size="4" :style="pointStyle"/> <v-view :view-id="2" :data="data"> <v-area :position="'time*temperature'" /> </v-view> </v-chart>

failed to run demo, Cannot find module './ErrorBar'.

I tried to run viser demo following your guide.

$ npm run postinstall
$ cd ./demo && npm install
$ npm run start

when exec the last command, here is the error msg

ERROR in ../packages/viser/src/shapes/loadShapes.ts
(2,27): error TS2307: Cannot find module './ErrorBar'.

ERROR in ../packages/viser/src/shapes/loadShapes.ts
Module not found: Error: Can't resolve './ErrorBar' in '/root/Downloads/viser/packages/viser/src/shapes'
 @ ../packages/viser/src/shapes/loadShapes.ts 4:15-36
 @ ../packages/viser/src/core/CommonChart.ts
 @ ../packages/viser/src/index.ts
 @ ./chart/bar-1/json.ts
 @ ./chart ^\.\/.*$
 @ ./index.ts
 @ multi ./index.ts
webpack: Failed to compile.

then I checked the file /path/to/packages/viser/src/shapes/loadShapes.ts and the file /path/to/packages/viser/src/shapes/Errorbar.ts
I cannot find any error, in grammar.

any help?

my develop env is node 8.9.1, npm 5.5.1

bug: getDataView should check data is Null

CommonDataSet.prototype.getDataView = function (data, dataView) {
    if (dataView === void 0) { dataView = 'rows'; }
    if (__WEBPACK_IMPORTED_MODULE_0_lodash__["isArray"](dataView) && dataView.length >= 2) {
        var type = dataView[0];
        if (__WEBPACK_IMPORTED_MODULE_0_lodash__["isFunction"](dataView[1])) {
            if (type === 'nodes') {
                return dataView[1](data.getAllNodes());
            }
            else if (type === 'edges') {
                return dataView[1](data.getAllLinks());
            }
        }
    }
    return data[dataView];    // when data=[] , it will occure bug
};

Legend don't support property 'show'

While more than 1 legend (ex. 2 legend called foo, bar) display in chart, <Legend dataKey="foo" show={false} /> is required to leave bar as only legend in chart.

Please support this, thanks.

[BUG]在element ui tabs组件使用的问题

在element ui tabs组件中,如果放在非第一个标签页里,点击切换到其余标签页时,图表没有渲染出来,但当我打开浏览器开发者工具时才会进行渲染。
但我如果一直打开开发者工具,刷新进行切换也不会渲染,只有关闭开发者工具才会渲染。
不知是触发渲染的机制出现了问题?

是否有事件可以进行手动初始化?目前没有文档十分不方便

浏览器:Chrome 63.0.3239.108
vue: 2.5.9
viser-vue: 1.3.0

横轴时间如何正确显示柱状图

图片试了多次没有上传上来,结果就是数据柱状图最左侧的柱子压住了y轴,特别是只有一个柱子的时候。
要怎么才能实现正常的柱状图显示,
想不明白,为什么横轴为时间时,柱状图显示不正常,了解到你们文档上自动给设置为连续的类型了。
我感觉应该在柱状图时,时间不应该自动给转换成连续型。
设置类型‘timeCat’
const scale = {
date: {
type: 'timeCat',
alias: '时间'
}
};

求助,如何在datapre中使用两次tranform?

我在G2中用了两次tranform,不知viser中如何写。还是我tranform使用的方法不对?
const data = [
{ month: 'Jan', Tokyo: 7.0, London: 3.9 , shanghai:3.2, dalian:13.2},
{ month: 'Feb', Tokyo: 6.9, London: 4.2 , shanghai:3.3, dalian:23.2},
{ month: 'Mar', Tokyo: 9.5, London: 5.7 , shanghai:8.2, dalian:31.2},
{ month: 'Apr', Tokyo: 14.5, London: 8.5 , shanghai:10.1, dalian:13.2},
{ month: 'May', Tokyo: 18.4, London: 11.9, shanghai:5.2, dalian:13.2}
];
const ds = new DataSet();
const dv = ds.createView().source(data);
dv.transform({
type: 'fold',
fields: [ 'Tokyo', 'London'], // 展开字段集
key: '国外城市', // key字段
value: '国外气温', // value字段
});
dv.transform({
type: 'fold',
fields: [ 'shanghai', 'dalian'], // 展开字段集
key: '国内城市', // key字段
value: '国内气温', // value字段
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.