Fork me on GitHub

@jjttjj: @dm3 @raywillig the reason why (head (script :src "A") (script :src "B")) doesn't work is because the corresponding DOM is generated by Hoplon after it has loaded a HTML page with a <head> elem only containing the main.js. When the code in main.js runs, it inserts the script DOM elements into the head. This triggers async loading of those scripts. However, if the loaded HTML contains those <script> tags, then they are executed sequentially! (though they might be downloaded in parallel) In the example given, the order of the scripts matter, because they depend on each other. Earlier scripts define the AmCharts global variable and subsequent scripts are referencing it.


@jjttjj: I also recommend looking into CLJSJS and I might find some time to help you packaging it, though I've only packaged only which is mostly CSS with a relatively simple JS part...


We - at Exicon - are also missing a powerful charting library actually, but have had enough resources to allocate on packaging / building one.


we tried C3 which is already CLJSJ packaged, but it had issues with resizing


what about vega?


Dimple had similar issues too


as I see there are a lot more charting/graphing libs since then, so we should probably dive in again....


@dm3: what about it? have u tried it yet?


yeah, seems to be quite flexible


but i guess none of those libs are really hoplon compatible or even clojurescript compatible because they doesn't accept persistent data structures


nope, but you can trivially rerender the graph when data changes


@onetom thanks for the tips, that definitely explains a lot. I'm definitely going to create the package soon, just wanted to make sure i understand how to get things working at a "lower level" with hoplon first


for now i have the scripts loading in a series of $.getScript calls, each with a callback to getSript the next one


so the scripts are loading however there is still something wrong with the display everything looks all warped... I think the images that are including in amcharts are not being displayed? are there any similar things to know about relating to images referenced from js libs?


hmmmm it doesn't seem to be the image assets because the amcharts requires an image-path in the constructor and when i change that to gibberish it looks even worse. also doesn't seem to be an issue with the css file either since the items in the chart are styled according to the css file according to the chrome web tools...


not sure if the solution to all this is still just to make a cljsjs package and i'm just being stubborn trying to get it to work without. just seems like it should be at least possible, if ugly, to do without and since this is kinda more of an involved package with lots of js files and non-js assets i'd feel more comfortable after just seeing a basic demo of it working in hoplon first, but if this is dumb feel free to call me out simple_smile


you will see any resources that fail to load in the devtools errors


your image looks like multiple graphs rendered over the same element