{"action":"created","comment":{"url":"https://api.github.com/repos/cryogenian/slamdata/pulls/comments/78482107","id":78482107,"diff_hunk":"@@ -52,21 +53,31 @@ foreign import getOffsetClientRect ∷ ∀ eff.  HTMLElement → Eff (dom ∷ DO\n foreign import open ∷ ∀ eff. String → String → String → Window → Eff (dom ∷ DOM | eff) Unit\n foreign import close ∷ ∀ eff. Window → Eff (dom ∷ DOM | eff) Unit\n foreign import centerPopupWindowFeatures ∷ ∀ eff. Int → Int → Window → Eff (dom ∷ DOM | eff) String\n+foreign import setFontSize ∷ ∀ eff. HTMLElement → String → Eff (dom ∷ DOM | eff) Unit\n+foreign import getOffsetWidth ∷ ∀ eff. HTMLElement → Eff (dom ∷ DOM | eff) Int\n+foreign import getOffsetHeight ∷ ∀ eff. HTMLElement → Eff (dom ∷ DOM | eff) Int\n+foreign import getScrollWidth ∷ ∀ eff. HTMLElement → Eff (dom ∷ DOM | eff) Int\n+foreign import getScrollHeight ∷ ∀ eff. HTMLElement → Eff (dom ∷ DOM | eff) Int\n \n -- | Same as `getTextWidth` but w/o Eff wrapper. This function definitely has effects\n -- | of allocating canvas and should have `Eff (ref ∷ REF|e)` or `Eff (dom ∷ DOM|e)`\n -- | but since we don't use intermediate `canvas` anywhere it's safe to think about\n -- | this as pure function from font style and string to width.\n foreign import getTextWidthPure ∷ String → String → Number\n \n--- | Takes an array of (div) elements, array of available font sizes, maximum dimension and\n--- | returns sizes of fitted elements\n-foreign import fitTexts\n-  ∷ ∀ e\n-  . Array HTMLElement\n-  → Array Int\n-  → {width ∷ Int, height ∷ Int}\n-  → Eff (dom ∷ DOM|e) (Array {width ∷ Int, height ∷ Int})\n+fits ∷ ∀ eff. HTMLElement → Eff (dom ∷ DOM | eff) Boolean\n+fits el = (&&) <$> fitsHorizontally <*> fitsVertically\n+  where\n+  fitsHorizontally = (<=) <$> getScrollWidth el <*> getOffsetWidth el\n+  fitsVertically = (<=) <$> getScrollHeight el <*> getOffsetHeight el\n+\n+fitText ∷ ∀ eff. Array Int → HTMLElement → Eff (dom ∷ DOM | eff) (Maybe Int)","path":"src/Utils/DOM.purs","position":38,"original_position":38,"commit_id":"6baebf336330835d135d970ed0d2b87f66b2b1c3","original_commit_id":"6baebf336330835d135d970ed0d2b87f66b2b1c3","user":{"login":"beckyconning","id":457901,"avatar_url":"https://avatars.githubusercontent.com/u/457901?v=3","gravatar_id":"","url":"https://api.github.com/users/beckyconning","html_url":"https://github.com/beckyconning","followers_url":"https://api.github.com/users/beckyconning/followers","following_url":"https://api.github.com/users/beckyconning/following{/other_user}","gists_url":"https://api.github.com/users/beckyconning/gists{/gist_id}","starred_url":"https://api.github.com/users/beckyconning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckyconning/subscriptions","organizations_url":"https://api.github.com/users/beckyconning/orgs","repos_url":"https://api.github.com/users/beckyconning/repos","events_url":"https://api.github.com/users/beckyconning/events{/privacy}","received_events_url":"https://api.github.com/users/beckyconning/received_events","type":"User","site_admin":false},"body":"is this stack safe?","created_at":"2016-09-13T01:07:44Z","updated_at":"2016-09-13T01:07:44Z","html_url":"https://github.com/cryogenian/slamdata/pull/30#discussion_r78482107","pull_request_url":"https://api.github.com/repos/cryogenian/slamdata/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/cryogenian/slamdata/pulls/comments/78482107"},"html":{"href":"https://github.com/cryogenian/slamdata/pull/30#discussion_r78482107"},"pull_request":{"href":"https://api.github.com/repos/cryogenian/slamdata/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/cryogenian/slamdata/pulls/30","id":84970487,"html_url":"https://github.com/cryogenian/slamdata/pull/30","diff_url":"https://github.com/cryogenian/slamdata/pull/30.diff","patch_url":"https://github.com/cryogenian/slamdata/pull/30.patch","issue_url":"https://api.github.com/repos/cryogenian/slamdata/issues/30","number":30,"state":"open","locked":false,"title":"More PS-y fitText used to produce proportionally scaled metric labels","user":{"login":"beckyconning","id":457901,"avatar_url":"https://avatars.githubusercontent.com/u/457901?v=3","gravatar_id":"","url":"https://api.github.com/users/beckyconning","html_url":"https://github.com/beckyconning","followers_url":"https://api.github.com/users/beckyconning/followers","following_url":"https://api.github.com/users/beckyconning/following{/other_user}","gists_url":"https://api.github.com/users/beckyconning/gists{/gist_id}","starred_url":"https://api.github.com/users/beckyconning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckyconning/subscriptions","organizations_url":"https://api.github.com/users/beckyconning/orgs","repos_url":"https://api.github.com/users/beckyconning/repos","events_url":"https://api.github.com/users/beckyconning/events{/privacy}","received_events_url":"https://api.github.com/users/beckyconning/received_events","type":"User","site_admin":false},"body":"Also adjustments to the chart sizing stuff which was producing chart dimensions smaller than their container that weren't vertically aligned.","created_at":"2016-09-13T01:07:25Z","updated_at":"2016-09-13T01:07:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aee09e8845dc435d9faa9ae0772877a2a1670f3d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cryogenian/slamdata/pulls/30/commits","review_comments_url":"https://api.github.com/repos/cryogenian/slamdata/pulls/30/comments","review_comment_url":"https://api.github.com/repos/cryogenian/slamdata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cryogenian/slamdata/issues/30/comments","statuses_url":"https://api.github.com/repos/cryogenian/slamdata/statuses/6baebf336330835d135d970ed0d2b87f66b2b1c3","head":{"label":"beckyconning:metric-chart","ref":"metric-chart","sha":"6baebf336330835d135d970ed0d2b87f66b2b1c3","user":{"login":"beckyconning","id":457901,"avatar_url":"https://avatars.githubusercontent.com/u/457901?v=3","gravatar_id":"","url":"https://api.github.com/users/beckyconning","html_url":"https://github.com/beckyconning","followers_url":"https://api.github.com/users/beckyconning/followers","following_url":"https://api.github.com/users/beckyconning/following{/other_user}","gists_url":"https://api.github.com/users/beckyconning/gists{/gist_id}","starred_url":"https://api.github.com/users/beckyconning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckyconning/subscriptions","organizations_url":"https://api.github.com/users/beckyconning/orgs","repos_url":"https://api.github.com/users/beckyconning/repos","events_url":"https://api.github.com/users/beckyconning/events{/privacy}","received_events_url":"https://api.github.com/users/beckyconning/received_events","type":"User","site_admin":false},"repo":{"id":42771206,"name":"slamdata","full_name":"beckyconning/slamdata","owner":{"login":"beckyconning","id":457901,"avatar_url":"https://avatars.githubusercontent.com/u/457901?v=3","gravatar_id":"","url":"https://api.github.com/users/beckyconning","html_url":"https://github.com/beckyconning","followers_url":"https://api.github.com/users/beckyconning/followers","following_url":"https://api.github.com/users/beckyconning/following{/other_user}","gists_url":"https://api.github.com/users/beckyconning/gists{/gist_id}","starred_url":"https://api.github.com/users/beckyconning/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beckyconning/subscriptions","organizations_url":"https://api.github.com/users/beckyconning/orgs","repos_url":"https://api.github.com/users/beckyconning/repos","events_url":"https://api.github.com/users/beckyconning/events{/privacy}","received_events_url":"https://api.github.com/users/beckyconning/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/beckyconning/slamdata","description":"The web-based front-end for SlamData.","fork":true,"url":"https://api.github.com/repos/beckyconning/slamdata","forks_url":"https://api.github.com/repos/beckyconning/slamdata/forks","keys_url":"https://api.github.com/repos/beckyconning/slamdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/beckyconning/slamdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/beckyconning/slamdata/teams","hooks_url":"https://api.github.com/repos/beckyconning/slamdata/hooks","issue_events_url":"https://api.github.com/repos/beckyconning/slamdata/issues/events{/number}","events_url":"https://api.github.com/repos/beckyconning/slamdata/events","assignees_url":"https://api.github.com/repos/beckyconning/slamdata/assignees{/user}","branches_url":"https://api.github.com/repos/beckyconning/slamdata/branches{/branch}","tags_url":"https://api.github.com/repos/beckyconning/slamdata/tags","blobs_url":"https://api.github.com/repos/beckyconning/slamdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/beckyconning/slamdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/beckyconning/slamdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/beckyconning/slamdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/beckyconning/slamdata/statuses/{sha}","languages_url":"https://api.github.com/repos/beckyconning/slamdata/languages","stargazers_url":"https://api.github.com/repos/beckyconning/slamdata/stargazers","contributors_url":"https://api.github.com/repos/beckyconning/slamdata/contributors","subscribers_url":"https://api.github.com/repos/beckyconning/slamdata/subscribers","subscription_url":"https://api.github.com/repos/beckyconning/slamdata/subscription","commits_url":"https://api.github.com/repos/beckyconning/slamdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/beckyconning/slamdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/beckyconning/slamdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/beckyconning/slamdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/beckyconning/slamdata/contents/{+path}","compare_url":"https://api.github.com/repos/beckyconning/slamdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/beckyconning/slamdata/merges","archive_url":"https://api.github.com/repos/beckyconning/slamdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/beckyconning/slamdata/downloads","issues_url":"https://api.github.com/repos/beckyconning/slamdata/issues{/number}","pulls_url":"https://api.github.com/repos/beckyconning/slamdata/pulls{/number}","milestones_url":"https://api.github.com/repos/beckyconning/slamdata/milestones{/number}","notifications_url":"https://api.github.com/repos/beckyconning/slamdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/beckyconning/slamdata/labels{/name}","releases_url":"https://api.github.com/repos/beckyconning/slamdata/releases{/id}","deployments_url":"https://api.github.com/repos/beckyconning/slamdata/deployments","created_at":"2015-09-19T12:01:49Z","updated_at":"2016-07-12T20:20:42Z","pushed_at":"2016-09-13T01:05:18Z","git_url":"git://github.com/beckyconning/slamdata.git","ssh_url":"git@github.com:beckyconning/slamdata.git","clone_url":"https://github.com/beckyconning/slamdata.git","svn_url":"https://github.com/beckyconning/slamdata","homepage":null,"size":347317,"stargazers_count":0,"watchers_count":0,"language":"PureScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cryogenian:metric-chart","ref":"metric-chart","sha":"b873421bba9dd77fd82493e1431c75a2188f1d57","user":{"login":"cryogenian","id":10245930,"avatar_url":"https://avatars.githubusercontent.com/u/10245930?v=3","gravatar_id":"","url":"https://api.github.com/users/cryogenian","html_url":"https://github.com/cryogenian","followers_url":"https://api.github.com/users/cryogenian/followers","following_url":"https://api.github.com/users/cryogenian/following{/other_user}","gists_url":"https://api.github.com/users/cryogenian/gists{/gist_id}","starred_url":"https://api.github.com/users/cryogenian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cryogenian/subscriptions","organizations_url":"https://api.github.com/users/cryogenian/orgs","repos_url":"https://api.github.com/users/cryogenian/repos","events_url":"https://api.github.com/users/cryogenian/events{/privacy}","received_events_url":"https://api.github.com/users/cryogenian/received_events","type":"User","site_admin":false},"repo":{"id":30622455,"name":"slamdata","full_name":"cryogenian/slamdata","owner":{"login":"cryogenian","id":10245930,"avatar_url":"https://avatars.githubusercontent.com/u/10245930?v=3","gravatar_id":"","url":"https://api.github.com/users/cryogenian","html_url":"https://github.com/cryogenian","followers_url":"https://api.github.com/users/cryogenian/followers","following_url":"https://api.github.com/users/cryogenian/following{/other_user}","gists_url":"https://api.github.com/users/cryogenian/gists{/gist_id}","starred_url":"https://api.github.com/users/cryogenian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cryogenian/subscriptions","organizations_url":"https://api.github.com/users/cryogenian/orgs","repos_url":"https://api.github.com/users/cryogenian/repos","events_url":"https://api.github.com/users/cryogenian/events{/privacy}","received_events_url":"https://api.github.com/users/cryogenian/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cryogenian/slamdata","description":"The web-based front-end for SlamData.","fork":true,"url":"https://api.github.com/repos/cryogenian/slamdata","forks_url":"https://api.github.com/repos/cryogenian/slamdata/forks","keys_url":"https://api.github.com/repos/cryogenian/slamdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cryogenian/slamdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cryogenian/slamdata/teams","hooks_url":"https://api.github.com/repos/cryogenian/slamdata/hooks","issue_events_url":"https://api.github.com/repos/cryogenian/slamdata/issues/events{/number}","events_url":"https://api.github.com/repos/cryogenian/slamdata/events","assignees_url":"https://api.github.com/repos/cryogenian/slamdata/assignees{/user}","branches_url":"https://api.github.com/repos/cryogenian/slamdata/branches{/branch}","tags_url":"https://api.github.com/repos/cryogenian/slamdata/tags","blobs_url":"https://api.github.com/repos/cryogenian/slamdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cryogenian/slamdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cryogenian/slamdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/cryogenian/slamdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cryogenian/slamdata/statuses/{sha}","languages_url":"https://api.github.com/repos/cryogenian/slamdata/languages","stargazers_url":"https://api.github.com/repos/cryogenian/slamdata/stargazers","contributors_url":"https://api.github.com/repos/cryogenian/slamdata/contributors","subscribers_url":"https://api.github.com/repos/cryogenian/slamdata/subscribers","subscription_url":"https://api.github.com/repos/cryogenian/slamdata/subscription","commits_url":"https://api.github.com/repos/cryogenian/slamdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/cryogenian/slamdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/cryogenian/slamdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/cryogenian/slamdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/cryogenian/slamdata/contents/{+path}","compare_url":"https://api.github.com/repos/cryogenian/slamdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cryogenian/slamdata/merges","archive_url":"https://api.github.com/repos/cryogenian/slamdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cryogenian/slamdata/downloads","issues_url":"https://api.github.com/repos/cryogenian/slamdata/issues{/number}","pulls_url":"https://api.github.com/repos/cryogenian/slamdata/pulls{/number}","milestones_url":"https://api.github.com/repos/cryogenian/slamdata/milestones{/number}","notifications_url":"https://api.github.com/repos/cryogenian/slamdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cryogenian/slamdata/labels{/name}","releases_url":"https://api.github.com/repos/cryogenian/slamdata/releases{/id}","deployments_url":"https://api.github.com/repos/cryogenian/slamdata/deployments","created_at":"2015-02-11T00:36:12Z","updated_at":"2015-07-22T14:28:43Z","pushed_at":"2016-09-13T01:07:27Z","git_url":"git://github.com/cryogenian/slamdata.git","ssh_url":"git@github.com:cryogenian/slamdata.git","clone_url":"https://github.com/cryogenian/slamdata.git","svn_url":"https://github.com/cryogenian/slamdata","homepage":null,"size":346542,"stargazers_count":0,"watchers_count":0,"language":"PureScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cryogenian/slamdata/pulls/30"},"html":{"href":"https://github.com/cryogenian/slamdata/pull/30"},"issue":{"href":"https://api.github.com/repos/cryogenian/slamdata/issues/30"},"comments":{"href":"https://api.github.com/repos/cryogenian/slamdata/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/cryogenian/slamdata/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/cryogenian/slamdata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cryogenian/slamdata/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/cryogenian/slamdata/statuses/6baebf336330835d135d970ed0d2b87f66b2b1c3"}}}}
{"actor":{"display_login":"beckyconning"}}