{"action":"created","issue":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/3025","labels_url":"https://api.github.com/repos/bokeh/bokeh/issues/3025/labels{/name}","comments_url":"https://api.github.com/repos/bokeh/bokeh/issues/3025/comments","events_url":"https://api.github.com/repos/bokeh/bokeh/issues/3025/events","html_url":"https://github.com/bokeh/bokeh/pull/3025","id":113185162,"number":3025,"title":"Use numbro.js instead of Numeral.js","user":{"login":"dennisobrien","id":1168692,"avatar_url":"https://avatars.githubusercontent.com/u/1168692?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisobrien","html_url":"https://github.com/dennisobrien","followers_url":"https://api.github.com/users/dennisobrien/followers","following_url":"https://api.github.com/users/dennisobrien/following{/other_user}","gists_url":"https://api.github.com/users/dennisobrien/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisobrien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisobrien/subscriptions","organizations_url":"https://api.github.com/users/dennisobrien/orgs","repos_url":"https://api.github.com/users/dennisobrien/repos","events_url":"https://api.github.com/users/dennisobrien/events{/privacy}","received_events_url":"https://api.github.com/users/dennisobrien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-24T21:52:23Z","updated_at":"2015-10-26T04:43:11Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/bokeh/bokeh/pulls/3025","html_url":"https://github.com/bokeh/bokeh/pull/3025","diff_url":"https://github.com/bokeh/bokeh/pull/3025.diff","patch_url":"https://github.com/bokeh/bokeh/pull/3025.patch"},"body":"Bokeh issue #2922 details issues with attempting to format Infinity and NaN.  This was fixed in Numbro.js, an active fork from Numeral.js.\r\n\r\nThis PR uses Numbro.js 1.6.2 with some modifications to make it work.  I was hoping to just drop it in to the vendor folder and have it work, but I can see that there were many changes to Numeral.js to make it work and to pare it down.\r\n\r\nI have not done any paring down of this, just making it work.  But that might be a good next step.\r\n\r\nHere's the test I've been using.  This breaks in Bokeh 0.10.0 and before with a Javascript error.\r\n\r\n```\r\nfrom bokeh.io import output_notebook\r\noutput_notebook()\r\n\r\nfrom bokeh.io import show\r\nfrom bokeh.models import ColumnDataSource\r\nfrom bokeh.models.widgets import DataTable, TableColumn, NumberFormatter\r\nimport numpy as np\r\nimport pandas as pd\r\n\r\n\r\n# create a data frame with some np.NaN and np.Infinity values\r\ndf = pd.DataFrame(data=[[1, 2, 3], [1, 0, 4], [np.Infinity, 0, np.NaN]], columns=['x', 'y', 'z'])\r\nsource = ColumnDataSource(df)\r\n\r\ncolumns = [\r\n    TableColumn(field='x', title='x', formatter=NumberFormatter(format=\"0.0\")),\r\n    TableColumn(field='y', title='y', formatter=NumberFormatter(format=\"0.0%\")),\r\n    TableColumn(field='z', title='z', formatter=NumberFormatter(format=\"$0.0\")), \r\n]\r\ndata_table = DataTable(source=source, columns=columns, editable=False)\r\n\r\nshow(data_table)\r\n```"},"comment":{"url":"https://api.github.com/repos/bokeh/bokeh/issues/comments/151024673","html_url":"https://github.com/bokeh/bokeh/pull/3025#issuecomment-151024673","issue_url":"https://api.github.com/repos/bokeh/bokeh/issues/3025","id":151024673,"user":{"login":"dennisobrien","id":1168692,"avatar_url":"https://avatars.githubusercontent.com/u/1168692?v=3","gravatar_id":"","url":"https://api.github.com/users/dennisobrien","html_url":"https://github.com/dennisobrien","followers_url":"https://api.github.com/users/dennisobrien/followers","following_url":"https://api.github.com/users/dennisobrien/following{/other_user}","gists_url":"https://api.github.com/users/dennisobrien/gists{/gist_id}","starred_url":"https://api.github.com/users/dennisobrien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dennisobrien/subscriptions","organizations_url":"https://api.github.com/users/dennisobrien/orgs","repos_url":"https://api.github.com/users/dennisobrien/repos","events_url":"https://api.github.com/users/dennisobrien/events{/privacy}","received_events_url":"https://api.github.com/users/dennisobrien/received_events","type":"User","site_admin":false},"created_at":"2015-10-26T04:43:11Z","updated_at":"2015-10-26T04:43:11Z","body":"The failing test is `test_file_html_handles_js_only_resources` which compares the Javascript source from two different methods.  This warning points to an issue with unicode:\r\n```\r\n/home/travis/build/bokeh/bokeh/bokeh/tests/test_embed.py:159: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal\r\n```\r\n\r\nIt looks like `bokeh.embed.file_html` calls `encode_utf8` while the other side of the assert == does not.  It happens that the Javascript source for Numbro.js does include Unicode characters.  I'm including a change to the test that should fix this."}}