antvis/G2

【问题】官网样例测试问题 #4737

PiKesi522 posted onGitHub

<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/antvis/g2/blob/master/CONTRIBUTING.md 感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/antvis/g2/blob/master/CONTRIBUTING.md -->

G2官网图示样例错误,不知道是否是用了V5的方法但是sandbox仍使用4.2.9的原因? https://codesandbox.io/s/kh93m8?file=/index.ts https://codesandbox.io/s/csykfg?file=/index.ts

bug图示 image


posted by bigfacewo about 2 years ago

嗯嗯,应该是版本不一致导致的,最近修复一下。

posted by pearmini about 2 years ago

关于这个例子还有个问题,那就是我将G2版本改为5.0.0-rc1,但是页面没有显示任何内容 https://codesandbox.io/s/green-dream-n5x0eb image

我尝试在本地写代码测试,然后报错:

image

我把.projection({ type: "albersUsa" })这行代码去掉,可以渲染了,但是效果不对: image

所以,到底哪个版本才是正确的呢?

@pearmini

posted by bigfacewo about 2 years ago

抱歉,我知道原因了,那就是API文档中的代码和例子不符合。

projection方法改为了coordinate,但是文档并没有更新,

posted by bigfacewo about 2 years ago

抱歉,我知道原因了,那就是API文档中的代码和例子不符合。

projection方法改为了coordinate,但是文档并没有更新,

嗯嗯,我去把 API 文档中的改一下。

posted by pearmini about 2 years ago

Fund this Issue

$0.00
Funded

Pull requests