After attempting to integrate the Treant.js library into my Vue app for creating a tree diagram from JSON data, I encountered some errors. In my main view, here are the import statements...
import Vue from "vue"
import store from "../../store"
import { getWebSocket } from "../../services/util.js"
import '../../assets/css/Treant.css'
import '../../assets/scripts/raphael'
var Treant = require("../../assets/scripts/Treant")
When trying to initialize the Treant constructor with the JSON object (this.localTrace.route), an error message stating "Treant is not a constructor" appears, preventing the tree from being built.
Alternatively, I tried globally importing the library in my main.js file like this...
import "./assets/scripts/raphael"
import "./assets/scripts/Treant"
This approach allowed Vue to access the Treant.js code, but a new error arose - "this._R.setSize is not a function". This occurs at various points within the Treant.js code.
If you have any insights on resolving these issues, please share them.