HubNet web export files...?

43 views
Skip to first unread message

Shir-May Rapaport

unread,
Aug 25, 2025, 11:52:24 AM (13 days ago) Aug 25
to netlogo-users
Hi, I hope Im in the right place 😅 , I'm a computer science undergraduate student, and I'm working with an existing NetLogo project ( = Desktop version) and I'm converting it to its web version.
I watched the tutorial video in here - https://hubnetweb.org/docs/converting  , which really helped me! Thanks for that! :) 

But I still need help with something very fundamental - is there a way to export simulation files - after it's finished?

In the desktop version - I exported CSV files, but as far as I understand I can't do this in the web version. (Is that right?)

Is there an alternative way to save the simulation data? 

thank you and have a great day :) 

Michael Tamillow

unread,
Aug 25, 2025, 12:10:35 PM (13 days ago) Aug 25
to Shir-May Rapaport, netlogo-users
Hey Shir-May, have you checked out the web-extension: https://github.com/NetLogo/Web-Extension/wiki/Primitives

seems to have a download-file primitive you may find useful.

--
You received this message because you are subscribed to the Google Groups "netlogo-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netlogo-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/netlogo-users/44ec2abb-95db-4d86-b53d-2accf03aab37n%40googlegroups.com.

Shir-May Rapaport

unread,
Sep 3, 2025, 10:11:08 AM (4 days ago) Sep 3
to netlogo-users
thank you :) 
and i have another question, is there any way to attached to here the .nlogo + .json +.hnw.json files from the video of the guide - https://hubnetweb.org/docs/converting ?
Because I'm really, really having trouble adding a plot — a histogram — to the client page role UI that is client-specific and actually works (i.e., shows the data it's supposed to), instead of just staying empty like it is now. And this is after almost a week of trying with ChatGPT and Gemini, and it still doesn't work.   :( 
thank you 


client plots not working.png
ב-יום שני, 25 באוגוסט 2025 בשעה 19:10:35 UTC+3, Michael Tamillow כתב/ה:

Jason Bertsche

unread,
Sep 3, 2025, 6:12:12 PM (3 days ago) Sep 3
to shir...@gmail.com, netlog...@googlegroups.com

Hi Shir-May,

I'm the one who made HubNet Web and the conversion guide for it.  Thank you for your interest in the project.



is there a way to export simulation files - after it's finished?

In the desktop version - I exported CSV files, but as far as I understand I can't do this in the web version. (Is that right?)

You can export files in NetLogo Web, just not using language primitives like `file-open`.  Code that is running on web pages isn't allowed to talk directly to the user's file system—you can imagine what a problem it would be if any web page you went to could read all the files on your computer.  But there are language extensions available in NetLogo Web that enable you to handle files in ways that web browsers allow.  Unfortunately (and maybe ironically), the Web extension isn't one of them, as it isn't implemented in NetLogo Web.  (The `http-req` extension fills a similar purpose, but isn't API-compatible with desktop's Web extension, and won't help in this situation.)

The main way you should save a file from NetLogo Web is by using the `send-to` extension, which is available in both desktop NetLogo and NetLogo Web.  A very simple example of its usage would be: `send-to:file "my-favorite-fruits.txt" "grapes\napples\noranges\nbananas"`.

Also, you mentioned CSV files.  If it's helpful to you, the CSV extension is available in NetLogo Web.  However, its `to-file` and `from-file` primitives are not implemented on the web.

Finally, it sounds like you're having some difficulties with narrowcast/client-specific plots in HubNet Web.  The canonical example of narrowcast plots is the Oil Cartel model, which you might find helpful as a demonstration of how to do it.  Regardless, if you e-mail me the '.hnw.json' file for your model, I can help with getting your histogram to work.  After the experience of converting all 39 of the HubNet models in the NetLogo Models Library to run in HubNet Web, my bet is that I can figure this one out, too.

Jason Bertsche

Reply all
Reply to author
Forward
0 new messages