SuperAPI AI 工具集

pygraphistry-visualization

数据与分析

查看项目

更新于 10-15 21:55

技能介绍

用途:PyGraphistry 可视化技能,帮助在 Python 中把图数据渲染为可交互或静态的可视化结果,并控制分享权限。

主要能力:

  • 绑定与编码:bind(point_label、point_color、edge_color 等),encode_point_color、encode_edge_color、encode_point_size、encode_point_icon、encode_point_badge。支持分类映射与连续色带(palette 配合 as_continuous=True)。
  • 布局控制:通过 settings(url_params={...}) 设置 play、linLog、scalingRatio、gravity、edgeInfluence、precisionVsSpeed 等力导向参数;也可用 bind(point_x、point_y) 配合 play=0、lockedX/lockedY 使用外部坐标。
  • 场景与标签:pointSize、pointOpacity、edgeCurvature、showArrows、neighborhoodHighlight、showLabels、pointsOfInterestMax 等。
  • 静态导出:plot_static() 输出 SVG/PNG,或 graphviz-dot、mermaid-code 等文本引擎。
  • 分享控制:graphistry.privacy(mode='private'|'organization'|'public') 在生成分享链接前设置隐私级别。

使用方式:典型流程为 g.bind(...).encode_point_color(...).settings(url_params={...}) 后调用 g2.plot()。大图建议先过滤聚合、保留必要列,并用 GFQL 切片生成多个聚焦视图(使用 .gfql(),而非已弃用的 .chain())。

限制与注意:URL 参数中的十六进制颜色不带 #,而 Python API 的 encode_* 与 palette 使用 # 前缀。不要用 plot() 的 as_files、memoize 等参数当作隐私控制。图标需使用有效的 Font Awesome 名称。文档路由可参考本地 references 与官方 readthedocs 链接。具体收费、平台支持范围等资料暂未提供。