Show HN:Cascii——一个用纯JavaScript编写的便携式ASCII图构建器
Show HN: Cascii – A portable ASCII diagram builder written in vanilla JavaScript

原始链接: https://github.com/casparwylie/cascii-core

Cascii是一个无需依赖、基于网页的ASCII和Unicode图表构建器,使用原生Javascript编写。它不需要服务器、Web打包、库、标记或样式表;只需在浏览器中打开`cascii.html`即可。它托管在cascii.app,提供短链接和账户保存等功能。 其内部结构基于图层和字符管理。它提供基本的绘图、选择、分组、排序、复制和动态表格工具。用户可以自由绘制、擦除、自动保存和粘贴文本/导入。它支持各种图层:自由绘图、开关线、阶梯线、自由线、正方形、圆形、菱形、文本和表格。历史记录(撤销/重做)、线条样式、ASCII/Unicode支持和键盘快捷键增强了绘图过程。主要功能包括:ctrl-g(分组)、ctrl-c(复制)、ctrl-z(撤销)、ctrl-shift-z(重做)、ctrl-a(全选)、delete(删除图层)。欢迎贡献,并遵循Apache 2.0许可证。

Hacker News 最新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Show HN: Cascii – 一个用原生 JavaScript 编写的便携式 ASCII 图表构建器 (github.com/casparwylie) 8 分,由 ftr1200 发表,2 小时前 | 隐藏 | 过去 | 收藏 | 讨论 三个月前,我想绘制一个 ASCII 图表,将其包含在工作的一些文档中。我发现网上为数不多的工具都不够用,而且惊讶地发现没有更完善的工具能够完成这项工作。从那时起,我用原生 JavaScript 从零开始构建了 Cascii(我不是前端开发人员,这可能很明显……)。我希望它能正常工作。请访问 https://cascii.app 查看在线版本,报告问题,绘制图表以改进代码文档。希望您喜欢使用它。 加入我们,参加 6 月 16-17 日在旧金山举行的 AI 初创公司学校! 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系我们 搜索:

原文

Cascii is a web-based ASCII and Unicode diagram builder written in vanilla Javascript.

It has zero dependencies on any servers, web packing, libraries, and is no-markup and no-stylesheets. You can start building diagrams by simply opening the cascii.html file in a browser. Cascii is also hosted at cascii.app where you can get short links to your diagrams, open an account, etc.

Here is a diagram built with Cascii that loosely explains how Cascii is structured internally:

                                   ┌╶╶╶╶╶╶╶╶╶╶╶╶╶╶┐
                                   ╷ GroupManager ╷
                                   └╶╶╶╶╶╶╶╶╶╶╶╶╶╶┘
               ┌─────────────┐    /                  ┌─────────────┐
               │EventManager │   /           ┌───────│SquareLayer  │
               └─────────────┘  /            │       │─────────────│        ┌───────────────┐
                      \        /             │───────│CircleLayer  │   ┌────│SwitchLineLayer│
                       \      /              │       │─────────────│   │    │───────────────│
                        ┏━━━━━━━━━━━━┓       │───────│BaseLineLayer│◀──┐────│FreeLineLayer  │
                        ┃LayerManager┃◀──────┘       │─────────────│   │    │───────────────│
                        ┗━━━━━━━━━━━━┛       │───────│DiamondLayer │   └────│StepLineLayer  │
        ┌────────────┐ /      /       \      │       │─────────────│        └───────────────┘
        │CharManager │/      /         \     │───────│FreeLayer    │
        └────────────┘      /           \    │       │─────────────│
                           /             \   └───────│TableLayer   │
                     ┌────────────┐       \          └─────────────┘            Pixels!
                     │ ModeMaster │        •
                     └────────────┘      •   •                                     ▲
                                       •       •                                   │
                                     •           •                                 │
                                   •   CanvasCom   ────────────────────────────────┘
                                     •           •
                                       •       •
                                         •   •
                                           •
Edit/view: https://cascii.app/7c24a

Simply download and open the cascii.html file!

...Literally...

curl https://cascii.app -o cascii.html && open cascii.html

...Or...

If you are not making changes, it's recommended to use cascii.app directly so you can take advantage of short links and save your work. Locally, short links will not appear in your exports.

  • Basic drawing
  • Selection (area selection, multi-selection, resize, move)
  • Joints
  • Grouping
  • Ordering
  • Duplicating
  • Dynamic tables
  • Free draw / erase
  • Auto save (browser local storage)
  • Paste / import text
  • Layers: Free, Switch Lines, Steps Lines, Free Lines, Square, Circle, Diamond, Text, Table
  • History (undo/redo)
  • Line styling
  • ASCII and Unicode
  • ctrl-g Group
  • ctrl-c Copy layer
  • ctrl-z Undo
  • ctrl-shift-z Redo
  • ctrl-a Select all
  • backspace/delete Delete layer
  • shift-click Multi-select | single-select member of group
  • arrow keys Move layer
  • ctrl-v Paste text (when editing text), or paste as a layer in any other mode

Contributions are very welcomed. Please feel free to submit proposals directly in the form of a PR or Issue.

Licensed under the Apache License, Version 2.0

联系我们 contact @ memedata.com