Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump mermaid from 9.2.2 to 11.4.1 #365

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

faulty13
Copy link

@faulty13 faulty13 commented Dec 2, 2024

Summary of Changes

Updated the mermaid version, based on laurent22/joplin#8728, to access new chart types.

Reason for Changes

See issue: No diagram type detected for text "quadrantChart..."

Testing

I've run into some build issues, so haven't been able to test.

One test could be:

from dash import Dash, Input, Output, html

from dash_extensions import Mermaid

chart = """
quadrantChart
    title Reach and engagement of campaigns
    x-axis Low Reach --> High Reach
    y-axis Low Engagement --> High Engagement
    quadrant-1 We should expand
    quadrant-2 Need to promote
    quadrant-3 Re-evaluate
    quadrant-4 May be improved
    Campaign A: [0.3, 0.6]
    Campaign B: [0.45, 0.23]
    Campaign C: [0.57, 0.69]
    Campaign D: [0.78, 0.34]
    Campaign E: [0.40, 0.34]
    Campaign F: [0.35, 0.78]
"""
app = Dash()
app.layout = html.Div([Mermaid(id="mermaid"), html.Button("Click me", id="trigger")])


@app.callback(Output("mermaid", "chart"), Input("trigger", "n_clicks"), prevent_initial_call=True)
def set_chart(_):
    return chart


if __name__ == "__main__":
    app.run_server(port=9998)

@faulty13
Copy link
Author

faulty13 commented Dec 4, 2024

@emilhe - just checking is there anything I need to do to progress this?

@emilhe
Copy link
Owner

emilhe commented Dec 4, 2024

I just tested the change, i.e. simply bumping the version and build everything. Something goes wrong,

image

it seems like a build technical thing to me at a glance. If you get it working, please update here.

@ploncker
Copy link

How do you build the package? I tried bumping from 9.2.2 to 10.4.0 but no joy.

@emilhe
Copy link
Owner

emilhe commented Dec 16, 2024

@ploncker assuming you have setup your Python environmen and installed the relevant packages with npm, run

poetry run npm run build

in you terminal to build the project. Next, if you want to build the Python package, run

poetry build

You can see the build process in the pipeline definition.

@ploncker
Copy link

ploncker commented Dec 17, 2024

Getting a "path requested is not valid" error now, related to async-null.js. Which is what you got above. So that's at least reproducible. Why would this be being left out of the 'dash_extensions'?

You mention that the Mermaid component is a light wrapper of react-mermaid2, which makes it possible to draw flow diagrams.
This is quite an old library. Maybe it's just not compatible with the new Mermaid libs?? Anyway log below re async-null.js

File "blah/blah/python3.10/site-packages/dash/_validate.py", line 382, in validate_js_path
raise exceptions.DependencyException(
dash.exceptions.DependencyException: "dash_extensions" is registered but the path requested is not valid.
The path requested: "async-null.js"
List of registered paths: defaultdict(<class 'set'>, {'dash': {'dcc/dash_core_components.js.map', 'dash-renderer/build/dash_renderer.min.js.map', 'dash_table/bundle.js.map', 'dcc/async-mathjax.js.map', 'html/dash_html_components.min.js', 'deps/prop-types@15.8.1.min.js', 'dash_table/async-table.js', 'dcc/async-datepicker.js.map', 'deps/react-dom@16.14.0.min.js', 'deps/polyfill@7.12.1.min.js', 'dcc/async-upload.js', 'dcc/dash_core_components-shared.js.map', 'dcc/async-graph.js', 'dcc/dash_core_components-shared.js', 'dash_table/async-highlight.js.map', 'dash_table/bundle.js', 'dcc/async-highlight.js', 'dcc/async-datepicker.js', 'dcc/async-dropdown.js', 'dcc/async-graph.js.map', 'dcc/async-markdown.js.map', 'deps/react@16.14.0.min.js', 'dcc/async-slider.js', 'dash-renderer/build/dash_renderer.min.js', 'dash_table/async-export.js.map', 'dcc/async-dropdown.js.map', 'dcc/async-mathjax.js', 'dcc/async-slider.js.map', 'dash_table/async-table.js.map', 'html/dash_html_components.min.js.map', 'dcc/async-highlight.js.map', 'dcc/async-markdown.js', 'dash_table/async-highlight.js', 'dash_table/async-export.js', 'dcc/async-upload.js.map', 'dcc/dash_core_components.js'}, 'dash_extensions': {'async-lottie.js.map', 'async-mermaid.js', 'async-lottie.js', 'async-mermaid.js.map', 'dash_extensions.min.js.map', 'dash_extensions.min.js'}, 'plotly': {'package_data/plotly.min.js'}})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants