Comments (2)
from gui.
import { Canvas } from '@antv/g';
import { Renderer as CanvasRenderer } from '@antv/g-canvas';
import { Linear } from '@antv/gui';
import * as dat from 'dat.gui';
const renderer = new CanvasRenderer({
enableDirtyRectangleRenderingDebug: false,
enableAutoRendering: true,
enableDirtyRectangleRendering: true,
});
const canvas = new Canvas({
container: 'container',
width: 1000,
height: 600,
renderer,
});
const data = [
'蚂蚁技术研究院',
'智能资金',
'蚂蚁消金',
'合规线',
'战略线',
'商业智能线',
'CFO线',
'CTO线',
'投资线',
'GR线',
'社会公益及绿色发展事业群',
'阿里妈妈事业群',
'CMO线',
'大安全',
'天猫事业线',
'影业',
'OceanBase',
'投资基金线',
'阿里体育',
'智能科技事业群',
];
const tickData = data.map((d, idx) => {
const step = 1 / data.length;
return {
value: step * idx,
text: d,
state: 'default',
id: String(idx),
};
});
const linear = new Linear({
style: {
startPos: [0, 50],
endPos: [800, 50],
ticks: tickData,
label: {
minLength: 20,
maxLength: 80,
autoEllipsis: false,
optionalAngles: [20, 30, 45],
padding: [0, 0, 0, 0],
autoHide: false,
autoRotate:false,
rotate: 90
},
tickLine: {
appendTick: false,
},
axisLine: {
arrow: {
end: {
symbol: 'axis-arrow',
size: 10,
},
},
},
subTickLine: {
count: 4,
},
},
});
canvas.appendChild(linear);
这种情况,需要手动设置 label textBaseline,不做 infer 推断
style: {
default: {
textBaseline: 'bottom'
}
}
from gui.
Related Issues (20)
- 🥰 [FEATURE]: legend 扩展自定义能力
- [走查] Switch 组件
- GUI 设计文档
- ticksThreshold 是否改名为ticksInterval 更合适
- 【legend】图例组件若干问题
- 【slider】缩略轴若干问题
- Legend 问题 HOT 1
- Legend
- 使用 G 提供的增强版 Text
- Arc Axis 当 `label.align` 为 `tangential` 且 verticalFactor 为 -1 的时候展示有问题
- Slider 设计调整
- Legend item 层级有误 HOT 1
- miterLimit 导致渲染差异 HOT 1
- Sparkline Area 面积图在 SVG 下 opacity 不生效
- 安装启动后报找不到 __spreadArray 错误 HOT 4
- [走查] Tooltip 组件 HOT 5
- 连续图例指示器 size 配置项工作异常 HOT 1
- ts-essentials dependency HOT 1
- 分类图例分页器异常
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gui.