F2 icon indicating copy to clipboard operation
F2 copied to clipboard

官网折线图平移 demo 无法平移

Open 321802282 opened this issue 4 years ago • 10 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

不太清楚官网demo的是哪个版本的,现在用最新版本去创建图表,平移功能都会失败

Environment Info
f2 3.8.1
System -
Browser -

321802282 avatar Dec 09 '20 10:12 321802282

import F2 from "@antv/f2"; const ScrollBar = require("@antv/f2/lib/plugin/scroll-bar"); require("@antv/f2/lib/interaction/pan"); 改为 import F2 from "@antv/f2/dist/f2-all";import F2 from '@antv/f2/lib/index' import ScrollBar from '@antv/f2/lib/plugin/scroll-bar' import ToolTip from '@antv/f2/lib/plugin/tooltip' require('@antv/f2/lib/interaction/pan') require('@antv/f2/lib/component/guide/text') require('@antv/f2/lib/component/guide/line') 则可以正常显示

321802282 avatar Dec 10 '20 02:12 321802282

引入 /lib/index-all 也可以, /es/index-all 不行且会报 Illegal invocation

zhenyu-dev avatar Dec 23 '20 16:12 zhenyu-dev

引入 /lib/index-all 也可以, /es/index-all 不行且会报 Illegal invocation

import F2 from '@antv/f2/lib/index' import ScrollBar from '@antv/f2/lib/plugin/scroll-bar' import ToolTip from '@antv/f2/lib/plugin/tooltip' require('@antv/f2/lib/interaction/pan') require('@antv/f2/lib/component/guide/text') require('@antv/f2/lib/component/guide/line')

这样引入就可以了,可能是仓库更新了,但是demo没有

321802282 avatar Dec 24 '20 00:12 321802282

为什么关掉呢,虽然 lib/index 可以,但是 es/index 不行,说明有些代码的引用还是有问题的,你可以引用 commonJS 让代码运行没问题,但是少了 webpack 对 es module 的 tree shaking

zhenyu-dev avatar Dec 24 '20 01:12 zhenyu-dev

太特么坑了,官方不都是叫import F2 from '@antv/f2' 这么引用的吗,用到的页面在具体引用插件,import F2 from "@antv/f2/dist/f2-all"这种虽然问题解决了,但.....特么这种又有点别扭啊

xmt2018 avatar Jan 29 '21 01:01 xmt2018

太特么坑了,官方不都是叫import F2 from '@antv/f2' 这么引用的吗,用到的页面在具体引用插件,import F2 from "@antv/f2/dist/f2-all"这种虽然问题解决了,但.....特么这种又有点别扭啊

xmt2018 avatar Jan 29 '21 01:01 xmt2018

太特么坑了,官方不都是叫import F2 from '@antv/f2' 这么引用的吗,用到的页面在具体引用插件,import F2 from "@antv/f2/dist/f2-all"这种虽然问题解决了,但.....特么这种又有点别扭啊

import F2 from '@antv/f2/lib/index' import ScrollBar from '@antv/f2/lib/plugin/scroll-bar' import ToolTip from '@antv/f2/lib/plugin/tooltip' require('@antv/f2/lib/interaction/pan') require('@antv/f2/lib/component/guide/text') require('@antv/f2/lib/component/guide/line') 这样就可以了,应该是仓库代码更新,但是官网demo没有更新

321802282 avatar Jan 29 '21 02:01 321802282

半年了,官网demo还不更新,每次例子与实际不一致都要翻issue

zhongyue2332 avatar May 18 '21 07:05 zhongyue2332

echarts有滚动条的影响移动端上下滑动 highcharts的滚动条自定义样式不理想 antv f2翻了issues才知道demo引入方式有出入 哎~

sknightq avatar Jul 14 '21 05:07 sknightq

依然无法平移

liusk123 avatar Aug 12 '21 01:08 liusk123