coppeliaMLA / glasseye

An extension to markdown. Output uses a Tufte layout. D3 charts can be generated
MIT License
111 stars 13 forks source link

Graphs not rendering #57

Open anthillsocial opened 7 years ago

anthillsocial commented 7 years ago

SVG elements do not appear to be rendering so no graphs are visible.

demo.zip

I noticed that pip installed glasseye to a python3.5 directory: /usr/lib/python3.5/site-packages/glasseye

anthillsocial commented 7 years ago

Ok. Python files are fine & work with both py2 and py3 without errors. I did a diff between the generated html and the version hosted at: http://coppeliamla.github.io/glasseye/glasseye_markdownExample/

And noticed the addition of: <script src="js/colorbrewer.js"></script>

And a change in the coppeliamla.github.io example from: barchart( {"category":

To: barchart( {"label":

I then swapped the glasseyeCharts.js packaged with the glasseye python module with: http://coppeliamla.github.io/glasseye/glasseye_markdownExample/js/glasseyeCharts.js

And most of the charts appeared, apart from the "force" chart. So it looks like the issue is to do with a file versioning discrepancy of some sort....

coppeliaMLA commented 7 years ago

Thanks Tom. Yes I think you are right there. I must have updated the demo without updating pypi. I'll give it a full review shortly and make sure everything is in sync. Strange about the force layout. Sometimes that one is a little slow to load. Are there any errors for the force layout in the console? Cheers

coppeliaMLA commented 7 years ago

Ah I've found the problem with the force graph. Fixing it now!

coppeliaMLA commented 7 years ago

Hi @anthillsocial

I've refreshed pypi with the latest version of glasseye and check that this version generated the correct output when it is applied to markdownExample.md.

I've also synchronised any code used in the demo on github to avoid any confusion. You are probably best off recloning the repository and reinstalling from pypi to make sure it all lines up.

Let me know if you have any issues.

I've done quite a lot with charting side of glasseye which I haven't had time to make available to the markdown parsing part. But I have done this which you might find interesting

anthillsocial commented 7 years ago

Ok something odd.

  1. The http://coppeliamla.github.io/glasseye/demo/markdownExample.html demo works fine.

  2. Version downloaded from https://pypi.python.org/pypi/glasseye/0.1.15 doesn't generate graphs. To ensure i'm using the newest version, I navigate to the demo folder and trigger the script directly: python ../__main__.py markdownExample.md

  3. The git version (triggering the script in same way above) generates the graphs, though display is mucked up with lines missing, or unwanted fills. See image below:

2016-12-07-dec-12-1481133844_1182x736

coppeliaMLA commented 7 years ago

Ah sorry - that last problem is due to it not finding the css. Stupidly I have the GlasseyeCharts.css in the css folder and glasseyeCharts.css in the code. That doesn't cause a problem on my mac but does elsewhere. I've reuploaded to pypi so if you install it again you should get a correctly named file. Else you could change the copies of GlasseyeCharts.css to glasseyeCharts.css. (There should be a couple of copies now - one in the demo folder one in the root - potentially three if you cloned the repo)

As for problem 2 I'll try a clean install on my other machine to see if I can replicate it

anthillsocial commented 7 years ago

Downloaded from pypi and graphs displaying now. Though layout issues. Here's a .zip of the files rendered in demo. Off to put the kids to bed now so I might be some time.... ;) demo.zip

coppeliaMLA commented 7 years ago

hi I can't quite work out what's going on as the copy of glasseyeCharts.js in your zipped file seems to be an old one and doesn't to me look like the one on pypi or the one in the repo. Did it perhaps come from github before I did the update. In any case I will try to work out what has happened. But it has convinced me that the overall mechanism needs a bit of a rethink. When I built this I didn't know about Jekyll. I'm now thinking that something along those lines is a better way to go

anthillsocial commented 7 years ago

I just checked css and js files in pypi and in git version in both the glasseye/glasseye and glasseye/demo folders and they are 100% the old files so it looks like the right version hasn't been uploaded to git. As comparison when swapping in the http://coppeliamla.github.io/glasseye/demo/markdownExample.html js & css files then everything works as expected!

I think you've got a really nice little setup here. I'm always against too many dependencies. Much nicer for things to be able to work standalone, then provide means to integrate with other systems. Its very easy to see whats going on with your structure. A nice alteration (which I might get round to) might be to make it easier to override template files which I currently achieve via a bash script when rendering a directory of .md -> glasseye files.