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

Can't make visualizer-schema to work #12

Open
evilsneer opened this issue May 3, 2021 · 1 comment
Open

Can't make visualizer-schema to work #12

evilsneer opened this issue May 3, 2021 · 1 comment

Comments

@evilsneer
Copy link

evilsneer commented May 3, 2021

Hi!

I can't make schema visualizer-schema to work

[hodur/engine "0.1.8"]
[hodur/visualizer-schema "0.1.1"]

in my case
1 I build lein project
2 add go script in resources
3 make my index.html like below

   <!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Welcome to cjhike2</title>
</head>
<body onload="">
<div id="app" class="container">
    <div id="infoBoxHolder">
        <!-- Initially Empty, it is populated when updateInfoBox is called -->
    </div>
    <div id="myDiagramDiv" class="diagramDiv"></div>
</div>
<!--<script src="cljs-out/main.js" type="text/javascript"></script>-->
</body>

<!-- scripts and styles -->
{% style "/assets/bulma/css/bulma.min.css" %}
{% style "/assets/material-icons/css/material-icons.min.css" %}
{% style "/css/screen.css" %}

<script type="text/javascript">
        var csrfToken = "{{csrf-token}}";

</script>
{% script "/scripts/go.js" %} 
{% script "/scripts/my_diagram.js" %} << script from your lib
{% script "/cljs-out/dev-main.js" %} << my main with `visualizer/apply-diagram!`

</body>
</html>

4 main.cljs as below

(def meta-db (engine/init-schema
               '[Person
                 [^String first-name
                  ^String last-name
                  ^Gender gender]

                 ^:enum
                 Gender
                 [MALE FEMALE IRRELEVANT]]))

(defn show [] 
  (-> meta-db
    visualizer/schema
    visualizer/apply-diagram!))

(show)

so, when I open browser window I don't have any console issues and logs, but nothing shows.
when I call (show) from cljs console again I get #object[Error Error: Invalid div id; div already has a Diagram associated with it.] and actually the canvas appeared, but it is empty.

Is it possible that I need specific version of GoJS? I have GoJS v2.1.38

Originally posted by @evilsneer in #10 (comment)

@evilsneer
Copy link
Author

also tried GoJS v1.8.21 with no effect

@evilsneer evilsneer changed the title Can't make schema visualizer-schema to work Can't make visualizer-schema to work May 3, 2021
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

No branches or pull requests

1 participant