typora-issues icon indicating copy to clipboard operation
typora-issues copied to clipboard

Upgrade Diagram version / Diagram upstream bugs

Open abnerlee opened this issue 5 years ago • 22 comments

Just in case you had missed my delayed response to #3249 (merged above), here was the code used to generate the "overly small font" in win10 (Typora 0.9.86) on hiDPI monitor. I do think it's distinct from #1660. Thanks!

graph TD
    id1>New data available] --> |download data|download((Data))
    download --> id2(Tapestri Insights App)
    id2 --> id3(Concatenate-all-samples.md)
    id3 --> python
    file1 --> python{{concat_tap_variants.py}}
    id2 --> |manually|file1["export.zip (AF.csv, Variants.csv, etc)"]
    python --> |CLI|file2[all_insights_variants.csv]
    file2 --> R{{save_all_significant_genotypes.R}}
    download -.-> |"(bed, barcodes, loom, vcf, etc)"| R
    R --> file3[significant_genotypes.*.csv]
    file2 --> plotAllJupyter{{UMAP_Plot_All_Samples_1_Figure.ipynb}}
    file3 --> plotAllJupyter{{UMAP_Plot_All_Samples_1_Figure.ipynb}}
    plotAllJupyter --> file6[UMAP image plots]
    file1 --> |"(AF.csv, NGT.csv)"|plotall{{plot_all_individ_mds-aml.py}}
    plotall --> file5[UMAP image plots with zygosity option]
    file1 --> |"(AF.csv)"|plotUMAP{{UMAP_Plot_AvsB.pynb}}
    plotUMAP --> file4[UMAP image plot]
    style id1 fill:#f0f0f0,stroke:#ccc
    style file1 fill:#ffffed,stroke:orange,stroke-width:1px,stroke-dasharray: 2, 0
    style file2 fill:#ffffed,stroke:orange,stroke-width:1px,stroke-dasharray: 2, 0
    style file3 fill:#ffffed,stroke:orange,stroke-width:1px,stroke-dasharray: 2, 0
    style file4 fill:#ffffed,stroke:orange,stroke-width:1px,stroke-dasharray: 2, 0
    style file5 fill:#ffffed,stroke:orange,stroke-width:1px,stroke-dasharray: 2, 0
    style file6 fill:#ffffed,stroke:orange,stroke-width:1px,stroke-dasharray: 2, 0

jpcartailler avatar Apr 01 '20 13:04 jpcartailler

FYI it seems doing

.label div {
    font-size: 0.85rem !important;
    line-height: unset !important;
    font-family: 'trebuchet ms', verdana, arial !important;
}

fixes mermaid labels for me to be readable and have line wraps appear.

erichurkman avatar May 07 '20 01:05 erichurkman

@abnerlee can you better describe what this issue is? Because you keep closing issues without explanation, just pointing to this one. For example #3386 and #3403 require an upgrade of Mermaid to a newer version, but there is nothing in this issue above that is about updating Mermaid to a specific version, such as 8.4.8 which would resolve those to issues.

vassudanagunta avatar May 10 '20 20:05 vassudanagunta

@vassudanagunta The title already said "Upload Diagram version", so I think this is what this issue's topic

abnerlee avatar May 14 '20 14:05 abnerlee

@abnerlee So you mean "upgrade" not "upload"?

This issue here will never close because Mermaid will keep putting out new updates. It is already nearly 2 years old and has spanned many Mermaid upgrades.

By closing those other issues as duplicates of this one:

  • We lose the ability to track the status of a specific issue because they are never tied to an issue that will close. People who search the issue database can't tell if the specific issue is actually closed or not, because they are marked as duplicates of an issue that never closes.

  • You have no idea how many Mermaid feature requests are backlogged because you have closed them all. You can't count all the ones marked as duplicates of this one because some are actually resolved (in these two years you have updated Mermaid) and some are unresolved (awaiting the next update).

If, as I said above, you mark them as duplicates of a more specific issue, e.g. "Upgrade Mermaid to v8.4.8", problem solved.

Anyway, it's just my opinion. I know you are trying to make your issue database easier to manage, but I think it makes it harder.

vassudanagunta avatar May 14 '20 17:05 vassudanagunta

graph LR;
  A & B--> C & D

is also failing

gnzlbg avatar Jun 20 '20 20:06 gnzlbg

updated to 8.5.2

abnerlee avatar Jul 11 '20 04:07 abnerlee

Hey @abnerlee,

The UML dashed-line variation doesn't show as dashed. I thought at first it was the version, but given you've just updated it, the render still doesn't match for this:

classDiagram
	Alpha ..* Bravo
	Bravo ..|> Charlie
	Charlie ..> Delta

Renders as:

image

Should render as:

image

Is this an issue unrelated to the version of Mermaid? Thanks.

AshleighAdams avatar Jul 13 '20 08:07 AshleighAdams

may be related, Typora is using 8.5.2, while mermaid just upgraded to 8.6.0

abnerlee avatar Jul 21 '20 15:07 abnerlee

classDiagram dashed-line bug still here.Version 0.9.95

FooYoKon avatar Sep 14 '20 12:09 FooYoKon

classDiagram dashed-line bug still here.Version 0.9.95

https://qzy.im/blog/2020/05/typora-integrate-the-latest-version-of-mermaid/

markzl avatar Sep 15 '20 02:09 markzl

How can I check which version of MermaidJS is installed?

I wanted to try a beta feature, eg. https://mermaid-js.github.io/mermaid/#/flowchart?id=beta-flowcharts

Is there a way to replace the lib manually?

schmunk42 avatar Nov 26 '20 10:11 schmunk42

I hope to customize the address of mermaid-cnd to achieve the effect of configuring the mermaid version by myself; the current version of mermaid is fixed in the version of typora, resulting in not timely follow-up of mermaid; a mermaidURL is given in the configuration item;

kerwin612 avatar Feb 24 '21 02:02 kerwin612

For a temporary hack on MacOS, you can do something like:

Backup current Typora diagram lib

cp /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js.bak

Replace current library with latest version.

wget -O /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.10.2/mermaid.min.js

Some minor styling bugs (depending on the Typora theme you are using), but seems to work so far.

Note: this might break other diagram library features, although I don't think they are included any more.

tleish avatar Jun 23 '21 16:06 tleish

For a temporary hack on MacOS, you can do something like:

Backup current Typora diagram lib

cp /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js.bak

Replace current library with latest version.

wget -O /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.10.2/mermaid.min.js

Some minor styling bugs (depending on the Typora theme you are using), but seems to work so far.

Note: this might break other diagram library features, although I don't think they are included any more.

Is there a solution like this for Windows?

AhmedThahir avatar Dec 17 '21 14:12 AhmedThahir

For a temporary hack on MacOS, you can do something like: Backup current Typora diagram lib

cp /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js.bak

Replace current library with latest version.

wget -O /Applications/Typora.app/Contents/Resources/TypeMark/lib/diagram/diagram.min.js https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.10.2/mermaid.min.js

Some minor styling bugs (depending on the Typora theme you are using), but seems to work so far. Note: this might break other diagram library features, although I don't think they are included any more.

Is there a solution like this for Windows?

I managed to update the mermaid library on Windows, and I will explain what I did, although I can't really guarantee everything will still work, so you may want to keep a backup of the files you end up editing.

First, find the lib.asar file. It should be located in C:\Program Files\Typora\resources\lib.asar It is an archive format used by electron, so you can see it as an application specific .zip.

To open it you may use any tool you like. I used the ones suggested here.

So you would do the following: npx asar extract lib.asar lib_unpacked then replace the lib_unpacked\diagram\diagram.min.js with the newer version. I used this.

Lastly, use npx asar pack lib_unpacked lib.asar

From the next launch, you should have the updated Mermaid version, although I'm not sure if the changes will persist when Typora updates.

TendTo avatar Jan 02 '22 19:01 TendTo

It's unfortunate that typora still hasn't updated the mermaidjs version. Despite purchasing, I might switch to other alternatives. I'm quite disappointed.

AhmedThahir avatar Jan 18 '22 15:01 AhmedThahir

I realized that Typora 1.1.5 is using Mermaid 8.8.3. Is there any plan to update the library anytime soon?

Qwaz avatar Mar 03 '22 16:03 Qwaz

Any updates on this?

AhmedThahir avatar Mar 03 '22 17:03 AhmedThahir

Is there any update on issue #3371? That was posted in 2020, and I'm just facing the same issue here...

rnahumaf avatar Mar 16 '22 15:03 rnahumaf

Temporary hack on Linux (tested with Typora 1.2.4).

cd /usr/share/typora/resources
cp lib.asar lib.asar.bak
npx asar extract lib.asar destfolder
cd destfolder/diagram
wget -O diagram.min.js https://cdnjs.cloudflare.com/ajax/libs/mermaid/9.1.1/mermaid.min.js
cd ../..
npx asar pack destfolder lib.asar

I am currently testing git diagrams and they apparently work.

alessandropellegrini avatar May 20 '22 14:05 alessandropellegrini

Hi @abnerlee. Any change to put latest stable 9.1.1 into next Typora 1.3-dev? Many great improvements happened to Mermaid e.g. %%{init: . Thanks for great software! In meantime I'll try @alessandropellegrini hack.

Update: I think there's actually a bug in Typora that prevents %%init{ ... }%% being taken into account, since 8.14 shipped in latest 1.3.3-dev should have this feature in, hence filled https://github.com/typora/typora-issues/issues/5291

nanoant avatar Jun 07 '22 16:06 nanoant