{"action":"created","issue":{"url":"https://api.github.com/repos/slamdata/slamdata/issues/585","labels_url":"https://api.github.com/repos/slamdata/slamdata/issues/585/labels{/name}","comments_url":"https://api.github.com/repos/slamdata/slamdata/issues/585/comments","events_url":"https://api.github.com/repos/slamdata/slamdata/issues/585/events","html_url":"https://github.com/slamdata/slamdata/pull/585","id":124825230,"number":585,"title":"[SD-1224] API Cell, Replace VarMap","user":{"login":"jonsterling","id":55057,"avatar_url":"https://avatars.githubusercontent.com/u/55057?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsterling","html_url":"https://github.com/jonsterling","followers_url":"https://api.github.com/users/jonsterling/followers","following_url":"https://api.github.com/users/jonsterling/following{/other_user}","gists_url":"https://api.github.com/users/jonsterling/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsterling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsterling/subscriptions","organizations_url":"https://api.github.com/users/jonsterling/orgs","repos_url":"https://api.github.com/users/jonsterling/repos","events_url":"https://api.github.com/users/jonsterling/events{/privacy}","received_events_url":"https://api.github.com/users/jonsterling/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"jonsterling","id":55057,"avatar_url":"https://avatars.githubusercontent.com/u/55057?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsterling","html_url":"https://github.com/jonsterling","followers_url":"https://api.github.com/users/jonsterling/followers","following_url":"https://api.github.com/users/jonsterling/following{/other_user}","gists_url":"https://api.github.com/users/jonsterling/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsterling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsterling/subscriptions","organizations_url":"https://api.github.com/users/jonsterling/orgs","repos_url":"https://api.github.com/users/jonsterling/repos","events_url":"https://api.github.com/users/jonsterling/events{/privacy}","received_events_url":"https://api.github.com/users/jonsterling/received_events","type":"User","site_admin":false},"milestone":null,"comments":30,"created_at":"2016-01-04T19:48:55Z","updated_at":"2016-01-18T22:21:57Z","closed_at":"2016-01-18T21:41:18Z","pull_request":{"url":"https://api.github.com/repos/slamdata/slamdata/pulls/585","html_url":"https://github.com/slamdata/slamdata/pull/585","diff_url":"https://github.com/slamdata/slamdata/pull/585.diff","patch_url":"https://github.com/slamdata/slamdata/pull/585.patch"},"body":"I apologize for the size and scope of this PR, which got out of control. If I had planned things a bit better, it may have been possible to split it up into multiple PRs; it happened that the API Cell task ballooned into a number of things that had to be done in order for it to be possible.\r\n\r\n- [x] [SD-1224](https://slamdata.atlassian.net/browse/SD-1224): **API Cell Type**\r\n  - [x] [SD-1225](https://slamdata.atlassian.net/browse/SD-1225): *User can create API cell type as leaf*\r\n  - [x] [SD-1226](https://slamdata.atlassian.net/browse/SD-1226): *User can use next action toolbar to create dependent cell*\r\n  - [x] [SD-1228](https://slamdata.atlassian.net/browse/SD-1228): *Parameters grabbed from window location hash parameters*\r\n  - [x] [SD-1246](https://slamdata.atlassian.net/browse/SD-1246): *Replace `VarMap` value type*\r\n  - [x] [SD-1227](https://slamdata.atlassian.net/browse/SD-1227): *User can add & remove new parameters*.\r\n\r\n![screen shot 2016-01-15 at 2 15 58 pm](https://cloud.githubusercontent.com/assets/55057/12366837/913df97a-bb92-11e5-9985-0fcea7d5442b.png)\r\n\r\n\r\n### Remaining Questions\r\n\r\n- [ ] What icon should the API Cell type take? Currently it is using this odd \"share\" icon, but I'm fine with any suggestion.\r\n\r\n### Remarks\r\n\r\n#### On the `VarMap` and the `SQL^2` syntax\r\n\r\nThe `VarMap` used to use types from `SlamDown` as an approximation of the syntax of constant expressions in SQL^2, but this could no longer suffice for the needs of the API Cell. So, I added an implementation of the SQL^2 constant expression syntax (currently leaving open-ended the representation of dates, times, intervals, etc.), along with a parser and printer that conform to the [\"spec\"](http://slamdata.com/support/cheatsheet.pdf), and used this in the `VarMap`, extended with another constructor for uninterpreted SQL^2 query expressions.\r\n\r\n#### On the \"global var map\"\r\n\r\nBecause a \"default/global\" parameter valuation can be embedded in the hash string of a Notebook URL, this is stored as a `VarMap` in the Notebook state (this is kept updated through the routing machinery), and propagate to cells via `CellEvalInput`. In particular, the API Cell uses this in order to compute its own `VarMap`.\r\n\r\n#### On Embedding\r\n\r\nthis does not include any special handling for embedding, since the UI for embedding cells does not appear to have even been implemented in `new-halogen` yet. And, because it will not be the API Cell itself which is embedded in a 3rd party dashboard in most cases, but rather some child of the API Cell, I suppose it doesn't quite make sense to include any special treatment for it within this PR. (Unless I have misunderstood something)\r\n"},"comment":{"url":"https://api.github.com/repos/slamdata/slamdata/issues/comments/172669623","html_url":"https://github.com/slamdata/slamdata/pull/585#issuecomment-172669623","issue_url":"https://api.github.com/repos/slamdata/slamdata/issues/585","id":172669623,"user":{"login":"jonsterling","id":55057,"avatar_url":"https://avatars.githubusercontent.com/u/55057?v=3","gravatar_id":"","url":"https://api.github.com/users/jonsterling","html_url":"https://github.com/jonsterling","followers_url":"https://api.github.com/users/jonsterling/followers","following_url":"https://api.github.com/users/jonsterling/following{/other_user}","gists_url":"https://api.github.com/users/jonsterling/gists{/gist_id}","starred_url":"https://api.github.com/users/jonsterling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonsterling/subscriptions","organizations_url":"https://api.github.com/users/jonsterling/orgs","repos_url":"https://api.github.com/users/jonsterling/repos","events_url":"https://api.github.com/users/jonsterling/events{/privacy}","received_events_url":"https://api.github.com/users/jonsterling/received_events","type":"User","site_admin":false},"created_at":"2016-01-18T22:21:57Z","updated_at":"2016-01-18T22:21:57Z","body":"OK, sounds good. I'll chat with the rest of the frontend team about it."}}