Penrose平台:用纯文本符号创建惊艳图表的革命性工具

Penrose平台:用纯文本符号创建惊艳图表的革命性工具

【免费下载链接】penrose Create beautiful diagrams just by typing notation in plain text. 【免费下载链接】penrose 项目地址: https://gitcode.com/gh_mirrors/pe/penrose

Penrose是一个让用户通过纯文本符号创建高质量图表的平台,旨在让非专业人士也能轻松创建和探索复杂的技术可视化,从而普及视觉直觉的构建过程。官方文档:docs/,项目教程:README.md

快速开始

用户可直接在浏览器中试用Penrose,无需安装任何软件。更详细的分步介绍可参考教程,参考样式的信息可查阅文档

核心概念

Penrose的工作原理基于三种核心程序文件的协作:

Domain(领域)文件

定义了问题领域的基本概念和关系,例如集合论中的集合类型和各种集合关系。语法定义:DSLL grammar

Substance(实体)文件

描述了具体的实体和它们之间的关系实例,是对特定问题的具体描述。语法定义:Substance grammar

Style(样式)文件

控制图表的视觉呈现方式,包括形状、布局、颜色等视觉属性。语法定义:Style language grammar,选择器语法:Style selector grammar,块语法:Style block grammar

使用示例

以下是一个集合论领域的简单Penrose可视化示例:

集合论可视化示例

该示例由以下三个文件共同定义:

setTheory.domain

type Set

predicate Disjoint(Set s1, Set s2)
predicate Intersecting(Set s1, Set s2)
predicate Subset(Set s1, Set s2)

tree.substance

Set A, B, C, D, E, F, G

Subset(B, A)
Subset(C, A)
Subset(D, B)
Subset(E, B)
Subset(F, C)
Subset(G, C)

Disjoint(E, D)
Disjoint(F, G)
Disjoint(B, C)

AutoLabel All

euler.style

canvas {
  width = 800
  height = 700
}

forall Set x {
  shape x.icon = Circle { }
  shape x.text = Equation {
    string : x.label
    fontSize : "32px"
  }
  ensure contains(x.icon, x.text)
  encourage norm(x.text.center - x.icon.center) == 0
  layer x.text above x.icon
}

forall Set x; Set y
where Subset(x, y) {
  ensure disjoint(y.text, x.icon, 10)
  ensure contains(y.icon, x.icon, 5)
  layer x.icon above y.icon
}

forall Set x; Set y
where Disjoint(x, y) {
  ensure disjoint(x.icon, y.icon)
}

forall Set x; Set y
where Intersecting(x, y) {
  ensure overlapping(x.icon, y.icon)
  ensure disjoint(y.text, x.icon)
  ensure disjoint(x.text, y.icon)
}

安装与运行

源码运行

penrose/penrose-web/src目录下运行npm start启动Web应用。核心引擎源码:packages/core/

命令行运行

penrose/examples/目录下执行runpenrose my.substance my.style my.domain命令运行示例。命令行工具源码:packages/roger/

高级功能

形状库

Penrose提供了丰富的形状库,包含各种基本图形和组合图形。形状库文档:Shape-and-function-library

交互编辑器

Penrose提供了交互式编辑器,方便用户实时编辑和预览图表效果。编辑器源码:packages/editor/

示例集合

项目中包含大量示例,涵盖不同领域和应用场景。示例代码:packages/examples/

开发与贡献

开发指南

想要参与Penrose的开发?请参考CONTRIBUTING.md了解贡献流程和规范。

核心模块

许可证

本项目采用MIT License开源协议。

【免费下载链接】penrose Create beautiful diagrams just by typing notation in plain text. 【免费下载链接】penrose 项目地址: https://gitcode.com/gh_mirrors/pe/penrose

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值