Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added basic support for serving snippets of code up to the UI #454

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mikedewar
Copy link
Collaborator

so, for example:

curl "localhost:7070/macros" -d'{"Type":"annotation","Dimensions":{"X":10,"Y":20,"W":100,"H":10}}'

returns

{
  "Content": "<h1>What Ho, Streamtools!</h1>\n<script>\n    console.log(\"hello\")\n</script>\n",
  "Dimensions": {
    "H": 10,
    "W": 100,
    "Y": 20,
    "X": 10
  },
  "Type": "annotation",
  "Id": "4"
}

@nikhan
Copy link
Collaborator

nikhan commented May 2, 2014

what kind of experience do we want here?
because as it stands, the affordances built in this PR do little to automate the "settings" of a macro, meaning that if you wanted to write a macro in HTML that made a D3 chart you would need a way to specify which endpoint it was hitting. Making this UI friendly would require figuring out a way to parameterize JS/HTML in way similar to how the blocks are paramterized, but with the added difficulty of dealing with how to work with free-form HTML. Meaning that we'd have to create some kind of templating engine...

If we agree that the block is basically an HTML/JS block and that editing HTML/JS is required, then things become much simpler.

@mikedewar
Copy link
Collaborator Author

The way I would like to see this code used is to deliver carefully designed bits of HTML/JS to the user. The user would be able to adjust the position and size of the enclosing div by default; any other affordances would be provided by the delivered HTML/JS.

Would it make sense for me to make a sample annotation macro?

@nikhan
Copy link
Collaborator

nikhan commented May 2, 2014

so, you would have a D3 chart that has some kind of drop down that populates with the available blocks that it could listen to?

@mikedewar
Copy link
Collaborator Author

Sure!
On May 2, 2014 1:13 PM, "nik hanselmann" [email protected] wrote:

so, you would have a D3 chart that has some kind of drop down that
populates with the available blocks that it could listen to?


Reply to this email directly or view it on GitHubhttps://github.com//pull/454#issuecomment-42055248
.

@jacqui
Copy link
Collaborator

jacqui commented May 6, 2014

@nikhan wrote, "Meaning that we'd have to create some kind of templating engine..." and I had a minor freakout :)

So if I understand the discussion so far, this pull request is intended to lay the foundation for adding macros/comments to streamtools, but more work is required to get them in the GUI? If I'm wrong, please explain?

@nikhan
Copy link
Collaborator

nikhan commented May 6, 2014

yep, that's entirely right. but depending on how we want things to work in the interface, things in the backend may have to change.

@mikedewar
Copy link
Collaborator Author

I think probably this needs a couple of examples before it's going to
resolve into a good idea or not...
On May 6, 2014 9:45 AM, "nik hanselmann" [email protected] wrote:

yep, that's entirely right. but depending on how we want things to work in
the interface, things in the backend may have to change.


Reply to this email directly or view it on GitHubhttps://github.com//pull/454#issuecomment-42319812
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants