antvis / g2-plugin-slider Goto Github PK
View Code? Open in Web Editor NEWA datazoom slider plugin for G2.
License: MIT License
A datazoom slider plugin for G2.
License: MIT License
可不可以单独作为时间范围选择插件来使用?
当使用非线性数据时,设置了startRadio和endRadio后,设置minSpan,maxSpan为相同数值但是滑块还是可以调整大小。
另外是否有开关可以关闭选区范围调整,我想每次数据分片是固定的数量
[email protected] 在 module 引入初始化时报错
版本 2.1.1
无报错
在未进一步引用时便出现报错:
Uncaught (in promise) TypeError: Cannot read property 'Group' of undefined
at Object.<anonymous> (g2-plugin-slider.js:511)
at __webpack_require__ (g2-plugin-slider.js:30)
at Object.<anonymous> (g2-plugin-slider.js:96)
at __webpack_require__ (g2-plugin-slider.js:30)
at Object.<anonymous> (g2-plugin-slider.js:80)
at __webpack_require__ (g2-plugin-slider.js:30)
at g2-plugin-slider.js:73
at g2-plugin-slider.js:76
at webpackUniversalModuleDefinition (g2-plugin-slider.js:3)
at Object../node_modules/_@[email protected]@@antv/g2-plugin-slider/build/g2-plugin-slider.js (g2-plugin-slider.js:10)
前向依赖 G2 版本 3.4.5
安装插件:
npm i @antv/g2-plugin-slider --save
然后在项目中任意一个 js 文件中写入如下代码:
import G2Slider from '@antv/g2-plugin-slider';
运行即可。
拖动slider的start,当start等于end时,拖拽对象会自动变成整个区间(因为start和end黏在一起了),而且这种情况下要把start 和 end 拉开相当困难。
任何
如果可以限制start和end之间的距离,使得距离不要太小可能能解决。
如题,默认构建的 build/g2-plugin-slider.js:502
中 subClass.prototype.constructor = subClass
,为只读属性,语句无法操作成功。
Uncaught TypeError: Cannot assign to read only property 'constructor' of object '#<Group>'
at _inheritsLoose (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:497)
at eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:513)
at Object.eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:909)
at __webpack_require__ (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:25)
at Object.eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:91)
at __webpack_require__ (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:25)
at Object.eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:75)
at __webpack_require__ (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:25)
at eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:68)
at eval (webpack:///./node_modules/@antv/g2-plugin-slider/build/g2-plugin-slider.js?:71)
ares: "1.15.0"
brotli: "1.0.7"
chrome: "83.0.4103.122"
electron: "9.3.0"
http_parser: "2.8.0"
icu: "65.1"
llhttp: "2.0.1"
modules: "80"
napi: "5"
nghttp2: "1.40.0"
node: "12.14.1"
openssl: "1.1.0"
unicode: "12.1"
uv: "1.33.1"
v8: "8.3.110.13-electron.0"
zlib: "1.2.11"
滑动条目前可以通过textAttr 设置提示的样式或隐藏,请问是否可以设置提示默认隐藏,当鼠标移动到滑块或2个滑块之间的时候再显示? 或者是否让text出现在滑块上边,而不是左边?
In my practice, slider don't response to touch event, i.e. slider can't be used in mobile device.
When I init the slider it defaults to showing a slice of data from the middle.
How can I decide with which data the slider initializes?
先抱歉没按照issue格式写,我看到官网上的slider例子都是基于时间线性的,然后试了下非线性的发现不行,是不支持还是我写的不对,所以能提供一个slider的非线性的例子吗,比如如下数据结构
// 柱图数据
cons data = [
{name: 'item1', value: 10},
{name: 'item2', value: 20},
{name: 'item3', value: 40},
{name: 'item4', value: 50},
{name: 'item5', value: 60},
...
]
想动态更新数据,以前的Range插件
$.getJSON('url',
function(data) {
flowChart.changeData(data)
rainChart.changeData(data)
flowChart.repaint()
rainChart.repaint()
range.clear()
range = new G2.Plugin.range({
id : 'range', //DOM id
width : 800,
height : 26,
dim : 'time',
});
range.source(data);
range.link([ flowChart, rainChart ]);
range.render();
});
重新new了一下。。现在这么写每次下面都会出个移动条。。怎么解决
yAxis
(string)
必须声明,我们的 Slider 是带有背景图表的滑动条组件,该字段用于声明该背景图表的纵轴轴映射字段。
多个纵坐标的情况下,是否也能联动?
目前只有 pc 段有效,移动端无法使用。
在G2版本为2.3.13的环境下使用g2-plugin-slider会抛出异常,提示 Uncaught TypeError: Cannot read property 'Group' of undefined
g2-plugin-slider版本:2.1.0
G2版本:2.3.13
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.