Open
Conversation
…js example.md --offline才能看到。没有增加选项,仅作为功能验证
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
新增功能:从上到下渲染
解决issue #330
概述
ttd(top-to-down):用于控制渲染方向example.md、example.html以验证垂直渲染视觉与交互效果展示
使用ttd: true时:


未使用时:(保留原本渲染方式未更改)
配置变更
ttd配置项ttd: true时使用垂直渲染(自上而下);当缺省或为false时使用水平渲染(左右展开)markmap\example.md:1–6ttd改变代码改动(核心文件)
markmap\packages\markmap-view\src\view.tslinkHorizontal→linkVerticalconst linkShape = linkVertical()3, 39_relayout)nodeSize:横向间距略减(spacingHorizontal * 0.5),纵向间距显著增加(height + spacingVertical * 20)spacing:同父节点spacingVertical * 1.5,跨父节点spacingVertical * 2,叠加lineWidth230–252x = fnode.x - fnode.xSize / 2y = fnode.ywidth = fnode.xSizeheight = fnode.ySize - spacingVertical * 1.5259–264foreignObject内层增加transform: translate(30px, 90px)改善初始视觉466x固定在节点右缘(加半线宽),y从 70 到节点底部附近552–575502–508, 585–591, 599–6150.8(更紧),垂直方向乘1.2(更饱满)639–643新增演示页
markmap\example.md、markmap\example.html工具链与脚本
cross-envbuild:js脚本改为cross-env TARGET=... vite build,确保 Windows 下环境变量生效markmap\package.json:9–12, 14–21markmap\packages\markmap-lib\package.json:42–49markmap\packages\markmap-toolbar\package.json:55–62markmap\packages\markmap-view\package.json:68–83prettier匹配范围更精确并加引号,提升 PowerShell 下的可靠性markmap\package.json:14–21fetch-assets.ts支持盘符路径(如E:\...),本地文件用流读取而非fetchmarkmap\packages\markmap-cli\src\fetch-assets.ts:28–36行为影响与注意事项
ttd: true→ 垂直渲染;ttd: false或缺省 → 水平渲染translate(30px, 90px)、y=70)在不同内容密度下可能需按主题与线宽调优