Fork me on GitHub
#hoplon
<
2016-02-16
>
onetom14:02:39

@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.

onetom14:02:11

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

onetom14:02:39

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

onetom14:02:01

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

dm314:02:29

what about vega?

onetom14:02:51

Dimple had similar issues too

onetom14:02:22

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

onetom14:02:32

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

dm314:02:49

yeah, seems to be quite flexible

onetom15:02:35

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

dm315:02:00

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

jjttjj18:02:48

@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

jjttjj18:02:18

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

jjttjj18:02:32

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?

jjttjj18:02:56

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...

jjttjj19:02:50

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

dm320:02:18

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

dm320:02:07

your image looks like multiple graphs rendered over the same element