@ graphysdk/ 反应
Graphy为反应绘制了 SDK图. 构建一个图谱并从一个包中渲染出来. "Powered by Graphy"的标记默认在.
学习更多 图表.dev。 。 。 .
安装
npm install @graphysdk/react
需要反应19。 没有样式表可以导入 .
使用量
import { GraphProvider, GraphRenderer, createSpec, pipe, geom, scale } from '@graphysdk/react';
const spec = pipe(createSpec({ x: 'month', y: 'revenue' }), geom.bar(), scale.x(), scale.y());
export function Chart({ data }) {
return (
<GraphProvider data={data} spec={spec}>
<GraphRenderer />
</GraphProvider>
);
}
文档
可编辑图表
import { GraphProvider } from '@graphysdk/react';
import { EditableGraphRenderer } from '@graphysdk/react/editable';
export function EditableChart({ data, spec, isEditing }) {
return (
<GraphProvider data={data} spec={spec} mode={isEditing ? 'annotate' : 'readonly'}>
<EditableGraphRenderer />
</GraphProvider>
);
}
从同一条目导入命令以编辑代码中的图表 :
import { useGraphCommands } from '@graphysdk/react';
import { SetContentTitleCommand } from '@graphysdk/react/editable';
const { dispatch } = useGraphCommands();
dispatch(new SetContentTitleCommand({ title: 'Revenue by quarter' }));
隐藏标记
import { config, createSpec, geom, pipe } from '@graphysdk/react';
const spec = pipe(
createSpec({ x: 'month', y: 'revenue' }),
geom.bar(),
config({ content: { graphyBadge: { visible: false } } })
);
图表计数
制作浏览器构建在图表首次出现时发送一个匿名数. 计数包括图表类型和相类似的旗帜. 它不包括单元格值,列名,或标签. 开发建立一行控制台,不发送任何信息.
<GraphProvider data={data} spec={spec} telemetry={false}>
<GraphRenderer />
</GraphProvider>
自定义地理
插件作者使用相同的包. Geom,价值读者, defineGeomRenderer,以及 createGraphyKit 全部导出自 @graphysdk/react - 没有必要添加 @graphysdk/viz-engine 或者说 @graphysdk/react-renderer 作为直接的依赖.
import { Geom, createGraphyKit, defineGeomRenderer } from '@graphysdk/react';
其他软件包
明确的设置总是胜过此包的默认值 .
@graphysdk/react-renderer– 相同的反射组件, 默认删除@graphysdk/viz-engine—— 仅用于非反应主机的引擎
代理技能
安装 Graphy 代理技能 github.com/graphysdk/ 技能 (英语) 设置来自 Cursor, Claude Code 和其他编码代理的 SDK 和作者图表.
许可证
此套件可在PolyForm非商业,小企业,或32天自由审判下提供. 自由审判(Free Trial)只是局部或内部的评价——它并不覆盖一个公开的页面. 见 在审判中你能做的。 。 。 .
商业许可证, 跟我们谈谈。 。 。 .
支助
问题和社区帮助: 解析器。 。 。 .