Siyavula / asciisvg-sandbox

A modified version of the original ASCIIsvg editor.
GNU General Public License v3.0
1 stars 1 forks source link

Possible collaboration with Graphit #1

Open siefkenj opened 12 years ago

siefkenj commented 12 years ago

Hi. I am the author of graphit https://github.com/siefkenj/graphit a tool for creating mathematics graphics also based on asciisvg. I was wondering if we share common goals and could potentially pool resources.

leenremm commented 12 years ago

It is really nice to be in contact with another ascii-svg author!

My name is Leen Remmelzwaal and I am based in Cape Town, South Africa. I developed this software package to process images for a company called Siyavula Education. What are you using it for?

The software I have developed is a stable version, capable of producing 100% of the features of the original ascii-svg softeware plus 10% more useful graphing/axes functions. What stage of development are you on?

I have developed both the Javascript (original language) and a Python script along side one another. What language are you using?

siefkenj commented 12 years ago

Siyavula Education's mission statement looks great! I am working on tools to allow the creation and easy sharing of math problems at the University level. I see you already have a similar project!

Graphit is meant to be a tool for the easy creation of graphs for inclusion into questions. It's currently in a useable state in that you can type asciisvg code and download the svg it produces (with the code used to generate it) to your computer for inclusion in your documents.

Keeping the whole things web-based, I have been writing in javascript and coffee script. I haven't made significant changes to ascii-svg other than to encapsulate it so it doesn't leak global variables. Your code looks much more readable than the original source!

My current goal is to allow exporting to pdf files--something essential if one wants to include their graphics in a LateX document. It seems like the easiest way to accomplish this is to log the operations asciisvg does and replay them to a pdf-context created by pdfkit-www.

Other goals include the ability to include LateX equations (which should be doable with mathjax's svg output), and perhaps the ability to interactively position things like dots and text.

leenremm commented 12 years ago

I used to be affiliated with a university too, and an interactive formula & graph handler would have been amazing! Keep it up!

Are you looking to export the images into PDF? or a worksheet with images in it?

We steered away from PDF because we are working on web & mobile platforms. If you have a look at the code I wrote, I used the cairo library to convert SVG to PNG images (which work better in browsers for compatibility reasons).

Latex equations would be great to have in the images! Great idea!

siefkenj commented 12 years ago

Pdf export atm is so that you can include the graphics in LaTeX documents, but a future goal would be the ability to export a who pdf slide show with questions and graphics together.

Did you reimiliment the asciisvg api in python to draw with cairo, or do you create an SVG and then paint it to a cairo context with librsvg?

leenremm commented 12 years ago

I did re-implement the asciisvg in python so I could use cairo.

Thank you for cleaning up parts of the javasvg.js code!

Yesterday I created pythonsvg_server that provides users with a development interface for creating & testing their code (running the python engine pythonsvg.py), and outputting to the web browser in both SVG & PNG objects. It does require an APACHE server to be running though (instructions provided).

We are most likely migrating to pythonsvg entirely at the company I work with. What language are you focussing on using? Is Python a language you would like to migrate to also?

leenremm commented 12 years ago

What I think about:

Very nice idea for javascript. I did implemented these features in Python.

  • passing the id or the object you want to be drawn upon to updatePicture instead of having it seek out an element with a magical ID.

I removed the passing of IDs when I translated the code into Python. This feature is great for dynamic SVG images, but was not a feature we used (as we convert the images to PNG)

siefkenj commented 12 years ago

I would love to switch to python as the dev language, however, my aim is to make a graphing program that runs completely in the browser, so I'd like to stick with javascript/coffeescript (ATM, I use a server as a workaround to be able to prompt the users to save a graph with a suggested name). How do you use/plan to use this product. Is your goal to have all the graphs pre-computed server side and then served to the user, or are things like png support just for fallback for older browsers, or is it something else entirely? I think png conversion could be done directly in the browser by painting the SVG to a canvas element. An alternative I've also investigated a little bit is an emscripten compiled version of cairo, in which case you could actually use cairo directly in the browser from javascript.

leenremm commented 12 years ago

I have been struggling with the server-side vs client-side problem for a while now.

My proposed solution: I have recently developed a script that uses an HTML browser as an interface, an APACHE server running python (in a cgi-bin), and AJAX to communicate between them. Both SVG and PNG generation options are available, with a suggestion box & decent error handling. You are welcome to download it (folder name in the repo: _pythonsvgserver). README file included.

We are planning on loading the package on a local server here at Siyavula. This works very well for us, because now we can develop the script in Python & operate in a browser.

Let me know what you think?

On Fri, Sep 14, 2012 at 6:41 AM, siefkenj notifications@github.com wrote:

I would love to switch to python as the dev language, however, my aim is to make a graphing program that runs completely in the browser, so I'd like to stick with javascript/coffeescript (ATM, I use a server as a workaround to be able to prompt the users to save a graph with a suggested name). How do you use/plan to use this product. Is your goal to have all the graphs pre-computed server side and then served to the user, or are things like png support just for fallback for older browsers, or is it something else entirely? I think png conversion could be done directly in the browser by painting the SVG to a canvas element. An alternative I've also investigated a little bit is an emscripten compiled version of cairo, in which case you could actually use cairo directly in the browser from javascript.

— Reply to this email directly or view it on GitHubhttps://github.com/Siyavula/asciisvg-sandbox/issues/1#issuecomment-8551603.

Regards,

Leen Remmelzwaal Technical Content Editor, Siyavula

Website: www.siyavula.com Address: The Open Innovation Studio, 27 Buitenkant Street, Cape Town, 8001