You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XML is the one thing that could really benefit from some more work. Currently, we can load it, but it's hard to do anything with it because there is not yet an XML object like there is in Processing. An XML object could be really useful in tandem with p5.dom. An XML to JSON converter could also be useful even though that wouldn't always translate. I'd like to work on XML in theory, but in reality I'm not sure when I will get a chance, so if anybody is inspired they should go for it (and maybe open up a new ticket?).
More stuff that isn't supported and might be worth adding:
loadBytes() / saveBytes() --> actually spent a decent amount of time trying to figure this one out. Maybe this will help.
beginRecord() / endRecord() --> save a PDF of the sketch
Well, I didn't actually get to all of the file i/o methods listed in the original ticket. I tried to focus on what would be most relevant.
XML is the one thing I think could really benefit from some more work. Currently, we can load it, but it's hard to do anything with it because there is not yet an XML object like there is in Processing. An XML object could be really useful in tandem with p5.dom. An XML to JSON converter could also be useful even though that wouldn't always translate. I'd like to work on XML in theory, but in reality I'm not sure when I will get a chance, so if anybody is inspired they should go for it (and maybe open up a new ticket?).
More stuff I haven't gotten to but might be worth doing:
loadBytes() / saveBytes() --> actually spent a decent amount of time trying to figure this one out. Maybe this will help.
beginRecord() / endRecord() --> save a PDF of the sketch
oops sorry for jumping the gun. I'll update the issue to reflect the current status. if these are things you'd like to tackle at some point feel free to keep your name on this issue. otherwise go ahead and deassign yourself, thanks for all your work on this area!
A small note I think that it might make sense to include something like selectInput() as an easy path to handling some of the JS File API stuff (this tutorial is a nice start). Thanks for all your amazing work @therewasaguy!
1.) and the getContent('mammals') method is called should null be returned in such a case or a complete String like " <animal id="0" species="Capra hircus">Goat</animal><animal id="1" species="Panthera pardus">Leopard</animal><animal id="2" species="Equus zebra">Zebra</animal>" ?
2.) Also in case of getParent('mammals') should #document be returned?
3.) If I call getChildren("animal") will it return an array containing id,species,innerText ?
hm, what is the output for processing for this? i would try to match that conceptually as best as possible, unless it makes sense to deviate for some reason. maybe it would be useful to write out a spec of this object and methods first, and we could review to make sure it all fits together as expected, before you implement?
I will try it out on processing soon and let you know. But I think it should be null value if xml = animal node[0].
By the way I have done this in my PR #1255 using the class p5.XML and defined its methods and attributes too. So the loadXML() works fine except for just one thing on which I would like some help, which I have mentioned in the PR. You can check it out whenever you want :)
@lmccart What do you think should be a good approach to saving the sketch as a PDF? If memory serves me I guess someone did a similar GSoC project to save data as PDF? I guess this is it: https://github.com/zenozeng/p5.js-pdf
I am not really sure what the 3rd point is? Creating a vector of what?
Also about the XML functionality, the saveXML() hasn't been implemented yet right? Is that also planned? Is there also anything else remaining for JSON and XML or other files?
since we haven't heard much demand for the three remaining unimplemented pieces, I suggest we close this issue and focus on issues that are higher priority.
I agree with the bytes and pdf being pushed to the back, I've had a lot of student desire for svg/vector output to be native so they can more easily traverse p5js & css tasks & get vector information out for going to print & laser/plotter/cnc fabrication. I do think likely the svg should be an external library. But from our previous conversation, It seems a question of how possible it is given the current render setup. I also do believe that in order to get svg/vector implemented it would be super helpful to have someone with experience in this area.
yes, definitely. the svg issue is still open: #458.
though realistically, I just don't have the bandwidth to take it on anytime soon, but would welcome anyone interested in tackling it.
Activity
lmccart commentedon Sep 7, 2014
correct me if I'm wrong, but I think we can close this general issue with the great work from @therewasaguy. the last remaining bits to resolve are discussed in these issues:
https://github.com/lmccart/p5.js/issues/326
https://github.com/lmccart/p5.js/issues/280
therewasaguy commentedon Sep 9, 2014
Well, I didn't actually get to all of the file i/o methods listed in the original ticket. I tried to focus on what would be most relevant.
XML is the one thing I think could really benefit from some more work. Currently, we can load it, but it's hard to do anything with it because there is not yet an XML object like there is in Processing. An XML object could be really useful in tandem with p5.dom. An XML to JSON converter could also be useful even though that wouldn't always translate. I'd like to work on XML in theory, but in reality I'm not sure when I will get a chance, so if anybody is inspired they should go for it (and maybe open up a new ticket?).
More stuff I haven't gotten to but might be worth doing:
Stuff I don't think makes sense for p5:
lmccart commentedon Sep 10, 2014
oops sorry for jumping the gun. I'll update the issue to reflect the current status. if these are things you'd like to tackle at some point feel free to keep your name on this issue. otherwise go ahead and deassign yourself, thanks for all your work on this area!
therewasaguy commentedon Sep 10, 2014
I may dive back in at some point, but I'll deassign myself for now in case somebody else is interested in working on it in the meantime.
lmccart commentedon Sep 10, 2014
great, sounds good!
[-]implement file I/O to the extent it makes sense[/-][+]finish file I/O implementation[/+]shiffman commentedon Sep 11, 2014
A small note I think that it might make sense to include something like
selectInput()as an easy path to handling some of the JS File API stuff (this tutorial is a nice start). Thanks for all your amazing work @therewasaguy!10 remaining items
DarkPrince304 commentedon Feb 11, 2016
Hello @lmccart,
I have some queries that I came across while implementing this.
If the XML is like this
1.) and the
getContent('mammals')method is called should null be returned in such a case or a complete String like" <animal id="0" species="Capra hircus">Goat</animal><animal id="1" species="Panthera pardus">Leopard</animal><animal id="2" species="Equus zebra">Zebra</animal>"?2.) Also in case of
getParent('mammals')should#documentbe returned?3.) If I call
getChildren("animal")will it return an array containingid,species,innerText?lmccart commentedon Feb 12, 2016
1 it should match the behavior of processing wherever it makes sense. so if you run this in processing, you get something like:
so maybe it should return an array of these three items?
2 I think it should return null, matching the behavior of processing.
3 The output from processing is:
so perhaps it should return the raw elements or maybe an array of p5.XMLNode objects?
DarkPrince304 commentedon Feb 12, 2016
Woops! Sorry, about the 3rd question I meant what if xml = the animal node and then we call
xml.getChildern(). What will be the children of animal?Implemented loadXML() processing#40
Implemented loadXML() functionality processing#40
lmccart commentedon Feb 16, 2016
hm, what is the output for processing for this? i would try to match that conceptually as best as possible, unless it makes sense to deviate for some reason. maybe it would be useful to write out a spec of this object and methods first, and we could review to make sure it all fits together as expected, before you implement?
DarkPrince304 commentedon Feb 16, 2016
I will try it out on processing soon and let you know. But I think it should be null value if xml = animal node[0].
By the way I have done this in my PR #1255 using the class p5.XML and defined its methods and attributes too. So the loadXML() works fine except for just one thing on which I would like some help, which I have mentioned in the PR. You can check it out whenever you want :)
lmccart commentedon Feb 16, 2016
oops sorry missed that! will take a look next chance i get.
DarkPrince304 commentedon Dec 19, 2016
@lmccart Is this finished? Or is there anythiing left with file I/O ?
lmccart commentedon Dec 19, 2016
@DarkPrince304 the three checkboxes in the first post still need looking into.
DarkPrince304 commentedon Dec 19, 2016
@lmccart What do you think should be a good approach to saving the sketch as a PDF? If memory serves me I guess someone did a similar GSoC project to save data as PDF? I guess this is it: https://github.com/zenozeng/p5.js-pdf
I am not really sure what the 3rd point is? Creating a vector of what?
Also about the XML functionality, the saveXML() hasn't been implemented yet right? Is that also planned? Is there also anything else remaining for JSON and XML or other files?
Thanks
lmccart commentedon May 10, 2017
since we haven't heard much demand for the three remaining unimplemented pieces, I suggest we close this issue and focus on issues that are higher priority.
bmoren commentedon May 10, 2017
I agree with the bytes and pdf being pushed to the back, I've had a lot of student desire for svg/vector output to be native so they can more easily traverse p5js & css tasks & get vector information out for going to print & laser/plotter/cnc fabrication. I do think likely the svg should be an external library. But from our previous conversation, It seems a question of how possible it is given the current render setup. I also do believe that in order to get svg/vector implemented it would be super helpful to have someone with experience in this area.
lmccart commentedon May 10, 2017
yes, definitely. the svg issue is still open: #458.
though realistically, I just don't have the bandwidth to take it on anytime soon, but would welcome anyone interested in tackling it.