#graphviz #dot #component #web #interactive #graph #dot-ix

dot_ix_web_components

dot_ix 库提供的 Web 组件

9 个版本 (重大更新)

0.8.0 2024 年 8 月 10 日
0.7.0 2024 年 6 月 30 日
0.6.0 2024 年 6 月 9 日
0.5.0 2024 年 3 月 30 日
0.1.0 2024 年 2 月 4 日

#480 in 可视化

Download history 4/week @ 2024-04-21 12/week @ 2024-04-28 11/week @ 2024-05-19 20/week @ 2024-05-26 45/week @ 2024-06-02 202/week @ 2024-06-09 4/week @ 2024-06-16 220/week @ 2024-06-30 91/week @ 2024-07-28 83/week @ 2024-08-04

每月下载量 174 次
2 个crate中(通过 dot_ix)使用

MIT/Apache

355KB
4K SLoC

✒️ dot_ix

Crates.io docs.rs CI Coverage Status

🚧 这是一个正在进行中的工作

自己试试看:(demo_1demo_2

示例

原始概念

https://user-images.githubusercontent.com/2993230/253878816-0729970f-651f-45ef-a986-470f383b8018.mp4

用法

将以下内容添加到 Cargo.toml

dot_ix = "0.8.0"

# Enables the `FlexDiag` web component.
dot_ix = { version = "0.8.0", features = ["flex_diag"] }

# Enables server side dot generation.
# Requires graphviz `dot` to be installed server side.
dot_ix = { version = "0.8.0", features = ["server_side_graphviz"] }

开发

cargo install cargo-leptos

# Then, one of:
# * client side rendering -- uses WASM compiled graphviz to generate the graph.
cargo leptos watch
# * server side rendering -- runs `dot` on the server to generate the graph.
#   Requires `graphviz` to be installed.
cargo leptos watch --features "server_side_graphviz" -v

对于服务器端渲染,需要单独传递 "server_side_graphviz" 功能,因为该功能仍然需要为库编译启用,即。

  • 服务器端渲染
    • 库功能: "server_side_graphviz"
    • 二进制特征: "ssr,server_side_graphviz"
  • 客户端渲染
    • 库功能: ""
    • 二进制特征: ""

待办事项

🦜 随意选择其中任何一项 -- 这个项目不是我的主要关注点,但我应该会积极响应审查/合并事项。

  • 将crate拆分成多个子crate。
  • app::info_graph::InfoGraph 拆分成更小的组件。
  • 移除 main.scss 并用tailwind类替换。
  • 在SVG中内联样式。
  • 在SVG样式中内联字体。
  • rt/into_graphviz_dot_src/info_graph.rs 修改为写入缓冲区,而不是单个字符串。
  • 获取每个具有 "type" 的节点。
  • 获取tailwindcss类以附加到节点类型。
  • 获取主题/合并默认主题。
  • dot_ix 库从Web应用中分离出来,以便它可以嵌入其他应用。
  • GitHub Actions / 自动测试 / 发布 / 发布。
  • 沙箱:渲染预写的图
    • URL中的图
    • 链接到gist

依赖项

~19–35MB
~589K SLoC