{"action":"created","issue":{"url":"https://api.github.com/repos/plotly/plotly.js/issues/3109","repository_url":"https://api.github.com/repos/plotly/plotly.js","labels_url":"https://api.github.com/repos/plotly/plotly.js/issues/3109/labels{/name}","comments_url":"https://api.github.com/repos/plotly/plotly.js/issues/3109/comments","events_url":"https://api.github.com/repos/plotly/plotly.js/issues/3109/events","html_url":"https://github.com/plotly/plotly.js/pull/3109","id":370383090,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIzMDczNDcw","number":3109,"title":"add 'width' to box and violin trace","user":{"login":"Kully","id":10369095,"node_id":"MDQ6VXNlcjEwMzY5MDk1","avatar_url":"https://avatars1.githubusercontent.com/u/10369095?v=4","gravatar_id":"","url":"https://api.github.com/users/Kully","html_url":"https://github.com/Kully","followers_url":"https://api.github.com/users/Kully/followers","following_url":"https://api.github.com/users/Kully/following{/other_user}","gists_url":"https://api.github.com/users/Kully/gists{/gist_id}","starred_url":"https://api.github.com/users/Kully/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kully/subscriptions","organizations_url":"https://api.github.com/users/Kully/orgs","repos_url":"https://api.github.com/users/Kully/repos","events_url":"https://api.github.com/users/Kully/events{/privacy}","received_events_url":"https://api.github.com/users/Kully/received_events","type":"User","site_admin":false},"labels":[{"id":330750748,"node_id":"MDU6TGFiZWwzMzA3NTA3NDg=","url":"https://api.github.com/repos/plotly/plotly.js/labels/status:%20reviewable","name":"status: reviewable","color":"33a02c","default":false},{"id":282886925,"node_id":"MDU6TGFiZWwyODI4ODY5MjU=","url":"https://api.github.com/repos/plotly/plotly.js/labels/type:%20feature","name":"type: feature","color":"1f78b4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2018-10-15T23:33:09Z","updated_at":"2018-10-31T17:45:40Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/plotly/plotly.js/pulls/3109","html_url":"https://github.com/plotly/plotly.js/pull/3109","diff_url":"https://github.com/plotly/plotly.js/pull/3109.diff","patch_url":"https://github.com/plotly/plotly.js/pull/3109.patch"},"body":"re: https://github.com/plotly/documentation/pull/1090\r\ninspiration for joyplots found in community discussion here: https://community.plot.ly/t/ridgeline-joy-plots-in-dash-automatic/12602\r\n\r\nFirst PR for js, whooho 🎉 \r\n\r\n---\r\n\r\nThis is my first shot at adding a `width` parameter for violin and box (I am calling the param `vwidth` for now). So far it works okay. The only thing I am noticing is that\r\n\r\n1. all traces in the `data` object have to be set to the same value in order for there to be any update to the plot\r\n\r\nRunning this script\r\n\r\n```javascript\r\nfunction violin(y0, fillcolor, vwidth) {\r\n    var v = {\r\n      type: 'violin',\r\n      vwidth: vwidth,\r\n      x: [0, 5, 7, 8],\r\n      points: 'none',\r\n      side: 'positive',\r\n      box: {\r\n        visible: false\r\n      },\r\n      boxpoints: false,\r\n      line: {\r\n        color: 'black'\r\n      },\r\n      fillcolor: fillcolor,\r\n      opacity: 0.6,\r\n      meanline: {\r\n        visible: false\r\n      },\r\n      y0: y0\r\n    };\r\n    return v\r\n};\r\n\r\nvar data = [\r\n  violin(0.0, '#8dd3c7', 0.4),\r\n  violin(0.1, '#d3c78d', 0.4),\r\n  violin(0.2, '#c78dd3', 0.4),\r\n];\r\n\r\nvar layout = {\r\n  title: \"Horizontal JoyPlot\",\r\n  xaxis: {\r\n    zeroline: false\r\n  },\r\n  violingap: 0\r\n};\r\n\r\nPlotly.newPlot('graph', data, layout);\r\n```\r\n\r\nI get:\r\n\r\n![newplot](https://user-images.githubusercontent.com/10369095/46983946-cef84a00-d0b0-11e8-901e-a1f823430599.png)\r\n\r\n\r\nand tweaking\r\n\r\n```javascript\r\nvar data = [\r\n  violin(0.0, '#8dd3c7', 1),\r\n  violin(0.1, '#d3c78d', 1),\r\n  violin(0.2, '#c78dd3', 1),\r\n];\r\n```\r\n\r\nto\r\n\r\n```javascript\r\nvar data = [\r\n  violin(0.0, '#8dd3c7', 1),\r\n  violin(0.1, '#d3c78d', 0.4),\r\n  violin(0.2, '#c78dd3', 1),\r\n];\r\n```\r\n\r\nI get the following:\r\n\r\n![newplot 1](https://user-images.githubusercontent.com/10369095/46983950-d4559480-d0b0-11e8-9737-1303429e014e.png)\r\n\r\n\r\nAnd changing the snippet to\r\n\r\n```javascript\r\nvar data = [\r\n  violin(0.0, '#8dd3c7', 0.4),\r\n  violin(0.1, '#d3c78d', 0.4),\r\n  violin(0.2, '#c78dd3', 0.4),\r\n];\r\n```\r\n\r\nwhere all the `vwidths` are 0.4, we get what we should be getting.\r\n\r\n![newplot 2](https://user-images.githubusercontent.com/10369095/46983955-db7ca280-d0b0-11e8-98c6-6a35b1e9e1e6.png)\r\n\r\n---\r\n\r\nI am contemplating switching `vwidth` to a layout attribute in the same category as `violingap`. I would appreciate some input before continuing.\r\n\r\ncc @etpinard \r\n"},"comment":{"url":"https://api.github.com/repos/plotly/plotly.js/issues/comments/434783410","html_url":"https://github.com/plotly/plotly.js/pull/3109#issuecomment-434783410","issue_url":"https://api.github.com/repos/plotly/plotly.js/issues/3109","id":434783410,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNDc4MzQxMA==","user":{"login":"etpinard","id":6675409,"node_id":"MDQ6VXNlcjY2NzU0MDk=","avatar_url":"https://avatars0.githubusercontent.com/u/6675409?v=4","gravatar_id":"","url":"https://api.github.com/users/etpinard","html_url":"https://github.com/etpinard","followers_url":"https://api.github.com/users/etpinard/followers","following_url":"https://api.github.com/users/etpinard/following{/other_user}","gists_url":"https://api.github.com/users/etpinard/gists{/gist_id}","starred_url":"https://api.github.com/users/etpinard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etpinard/subscriptions","organizations_url":"https://api.github.com/users/etpinard/orgs","repos_url":"https://api.github.com/users/etpinard/repos","events_url":"https://api.github.com/users/etpinard/events{/privacy}","received_events_url":"https://api.github.com/users/etpinard/received_events","type":"User","site_admin":false},"created_at":"2018-10-31T17:45:40Z","updated_at":"2018-10-31T17:45:40Z","author_association":"MEMBER","body":"> I'm not very happy with the fact that the violin has gotten smaller by default,\r\n\r\nYes, that's a problem. The existing baselines should not changed in this PR."}}
{"actor":{"display_login":"etpinard"}}