flatironinstitute / stan-playground

Run Stan models in the browser
Apache License 2.0
36 stars 1 forks source link

data and analysis script examples available to user #149

Closed magland closed 4 months ago

magland commented 4 months ago

I think it would be helpful for there to be a "?" icon at the top of the editors that would show documentation for writing the analysis. and data. scripts. Otherwise, I think a user wouldn't know how to get started when opening these tabs. I think this should be in the form of a markdown document that is opened as a popup window. I have some react components that can render markdown, including code snippets. But to start we could also just link to docs on github containing examples.

Let me know if you want me to get started on this.

WardBrian commented 4 months ago

I think we should probably update the default values for these files to be a comment explaining them, rather than them defaulting to empty. That should be more than sufficient for the data ones, at least. Analysis scripts may need something closer to what you describe to fully explain them

magland commented 4 months ago

I think we should probably update the default values for these files to be a comment explaining them, rather than them defaulting to empty. That should be more than sufficient for the data ones, at least. Analysis scripts may need something closer to what you describe to fully explain them

I don't like the idea of every saved project having comment-only files called data.py, data.R, etc. I think they should be empty if not used, so they don't get included in the export

WardBrian commented 4 months ago

That’s a fair point. We could update the export logic to check if they’re different from their defaults AND nonempty before including them, if we wanted.

I think some users will honestly miss the ? — I hadn’t really taken note myself

magland commented 4 months ago

How about, if the editor is empty, then display a special noticeable message in the toolbar: GET STARTED or something. If not empty, then it's just a "?" icon.

WardBrian commented 4 months ago

That would be more noticeable.

It occurs to me this is similar to how we repurpose the syntax error window to suggest a user click an example. I’ve been wanting to replace that with something like what VSCode shows when there is no text. It looks like this can be done with Monaco, and is an option for at least those things we think we can sufficiently explain in 1 line:

https://github.com/microsoft/monaco-editor/issues/568#issuecomment-1499966160

magland commented 4 months ago

That's a cool idea. Let me take a crack at that for the stan editor.

magland commented 4 months ago

... unless you already started.

WardBrian commented 4 months ago

I’ve headed out for the night, so feel free! I’m curious if it’s really as easy as the linked solution makes it seem…