{"size":{"Width":780,"Height":430},"appearance":{"background":null,"padding":14,"font":{"family":"Courier New","size":10.0,"bold":false,"italic":false,"underline":false,"strikeout":false,"color":"rgb(0,72,168)"},"border":{"on":true,"size":0.0,"style":"solid","color":"#666"},"text":{"wrap":true,"hAlign":"Left","vAlign":"Top","resize":"ResizeShapeToFitText"}},"outputType":"WIDGET","widgetStateDict":{},"wikiPageTitle":null,"hasReferences":{"propertyAppearanceFont":false,"propertyAppearanceParagraph":false,"propertyAppearanceWrap":false,"propertyAppearanceBorder":false,"propertyAppearanceBackgroundColor":false,"propertyFilters":false,"propertyWeight":false},"hasChartData":false,"useFastExecutor":true,"outputs":{"htmlwidgets":"<div id=\"htmlwidget_container\">\n <div id=\"htmlwidget-c90654175793e51d6612\" style=\"width:100%;height:400px;\" class=\"plotly html-widget\"></div>\n</div>\n<script type=\"application/json\" data-for=\"htmlwidget-c90654175793e51d6612\">{\"x\":{\"visdat\":{\"65f2586bd86c\":[\"function () \",\"plotlyVisDat\"]},\"cur_data\":\"65f2586bd86c\",\"attrs\":{\"65f2586bd86c\":{\"x\":[3,4,4.2,4.5,4.7],\"y\":[10,12,15,20,30],\"z\":[[0,0.784889196456223,1.57468193958775,1.97256553421447,2.31951817146965],[-0.498709617106191,0.286179579350032,1.07597232248156,1.47385591710828,1.82080855436346],[-0.83392859305446,-0.0490393965982368,0.740753346533289,1.13863694116001,1.48558957841519],[-2.38093787868603,-1.59604868222981,-0.806255939098286,-0.408372344471564,-0.0614197072163809],[-3.34903303908934,-2.56414384263312,-1.7743510995016,-1.37646750487487,-1.02951486761969]],\"text\":null,\"hoverinfo\":\"text\",\"contours\":{\"showlabels\":true},\"alpha_stroke\":1,\"sizes\":[10,100],\"spans\":[1,20],\"type\":\"contour\"}},\"layout\":{\"margin\":{\"b\":40,\"l\":60,\"t\":25,\"r\":10},\"xaxis\":{\"domain\":[0,1],\"automargin\":true,\"title\":\"Restaurant quality rating (out of 5)\",\"tickformat\":\"\",\"tickvals\":[\"3\",\"4\",\"4.2\",\"4.5\",\"4.7\"],\"autorange\":\"reversed\"},\"yaxis\":{\"domain\":[0,1],\"automargin\":true,\"title\":\"Price per diner\",\"tickformat\":\"$\",\"tickvals\":[\"10\",\"12\",\"15\",\"20\",\"30\"],\"autorange\":true},\"scene\":{\"zaxis\":{\"title\":[]}},\"hovermode\":\"closest\",\"showlegend\":false,\"legend\":{\"yanchor\":\"top\",\"y\":0.5}},\"source\":\"A\",\"config\":{\"modeBarButtonsToAdd\":[{\"name\":\"Collaborate\",\"icon\":{\"width\":1000,\"ascent\":500,\"descent\":-50,\"path\":\"M487 375c7-10 9-23 5-36l-79-259c-3-12-11-23-22-31-11-8-22-12-35-12l-263 0c-15 0-29 5-43 15-13 10-23 23-28 37-5 13-5 25-1 37 0 0 0 3 1 7 1 5 1 8 1 11 0 2 0 4-1 6 0 3-1 5-1 6 1 2 2 4 3 6 1 2 2 4 4 6 2 3 4 5 5 7 5 7 9 16 13 26 4 10 7 19 9 26 0 2 0 5 0 9-1 4-1 6 0 8 0 2 2 5 4 8 3 3 5 5 5 7 4 6 8 15 12 26 4 11 7 19 7 26 1 1 0 4 0 9-1 4-1 7 0 8 1 2 3 5 6 8 4 4 6 6 6 7 4 5 8 13 13 24 4 11 7 20 7 28 1 1 0 4 0 7-1 3-1 6-1 7 0 2 1 4 3 6 1 1 3 4 5 6 2 3 3 5 5 6 1 2 3 5 4 9 2 3 3 7 5 10 1 3 2 6 4 10 2 4 4 7 6 9 2 3 4 5 7 7 3 2 7 3 11 3 3 0 8 0 13-1l0-1c7 2 12 2 14 2l218 0c14 0 25-5 32-16 8-10 10-23 6-37l-79-259c-7-22-13-37-20-43-7-7-19-10-37-10l-248 0c-5 0-9-2-11-5-2-3-2-7 0-12 4-13 18-20 41-20l264 0c5 0 10 2 16 5 5 3 8 6 10 11l85 282c2 5 2 10 2 17 7-3 13-7 17-13z m-304 0c-1-3-1-5 0-7 1-1 3-2 6-2l174 0c2 0 4 1 7 2 2 2 4 4 5 7l6 18c0 3 0 5-1 7-1 1-3 2-6 2l-173 0c-3 0-5-1-8-2-2-2-4-4-4-7z m-24-73c-1-3-1-5 0-7 2-2 3-2 6-2l174 0c2 0 5 0 7 2 3 2 4 4 5 7l6 18c1 2 0 5-1 6-1 2-3 3-5 3l-174 0c-3 0-5-1-7-3-3-1-4-4-5-6z\"},\"click\":\"function(gd) { \\n // is this being viewed in RStudio?\\n if (location.search == '?viewer_pane=1') {\\n alert('To learn about plotly for collaboration, visit:\\\\n https://cpsievert.github.io/plotly_book/plot-ly-for-collaboration.html');\\n } else {\\n window.open('https://cpsievert.github.io/plotly_book/plot-ly-for-collaboration.html', '_blank');\\n }\\n }\"}],\"cloud\":false,\"displayModeBar\":false},\"data\":[{\"colorbar\":{\"title\":\"Utility\",\"ticklen\":2,\"len\":0.5,\"lenmode\":\"fraction\",\"y\":1,\"yanchor\":\"top\"},\"colorscale\":[[\"0\",\"rgb(68,1,84)\"],[\"0.138463809763981\",\"rgb(70,49,124)\"],[\"0.170783525532945\",\"rgb(68,59,129)\"],[\"0.277792663609449\",\"rgb(57,89,140)\"],[\"0.309247335296926\",\"rgb(53,98,141)\"],[\"0.347984072286426\",\"rgb(48,107,142)\"],[\"0.409190653010069\",\"rgb(43,122,142)\"],[\"0.443694403139539\",\"rgb(38,130,142)\"],[\"0.448576189142394\",\"rgb(38,131,142)\"],[\"0.502831026148932\",\"rgb(36,145,140)\"],[\"0.518767597819371\",\"rgb(35,149,139)\"],[\"0.579974178543014\",\"rgb(38,163,134)\"],[\"0.582158212903519\",\"rgb(38,164,133)\"],[\"0.590809346989931\",\"rgb(40,166,132)\"],[\"0.641294835912913\",\"rgb(50,177,125)\"],[\"0.721487066748987\",\"rgb(85,194,106)\"],[\"0.729273156753911\",\"rgb(89,195,104)\"],[\"0.780623689758381\",\"rgb(111,205,88)\"],[\"0.791678475425965\",\"rgb(119,207,85)\"],[\"0.850815098435359\",\"rgb(158,216,63)\"],[\"0.852885056149608\",\"rgb(159,217,62)\"],[\"0.868602010599379\",\"rgb(168,219,55)\"],[\"0.912021679159001\",\"rgb(196,224,43)\"],[\"0.938793419276357\",\"rgb(214,226,41)\"],[\"1\",\"rgb(253,231,37)\"]],\"showscale\":true,\"x\":[3,4,4.2,4.5,4.7],\"y\":[10,12,15,20,30],\"z\":[[0,0.784889196456223,1.57468193958775,1.97256553421447,2.31951817146965],[-0.498709617106191,0.286179579350032,1.07597232248156,1.47385591710828,1.82080855436346],[-0.83392859305446,-0.0490393965982368,0.740753346533289,1.13863694116001,1.48558957841519],[-2.38093787868603,-1.59604868222981,-0.806255939098286,-0.408372344471564,-0.0614197072163809],[-3.34903303908934,-2.56414384263312,-1.7743510995016,-1.37646750487487,-1.02951486761969]],\"hoverinfo\":\"text\",\"contours\":{\"showlabels\":true},\"type\":\"contour\",\"xaxis\":\"x\",\"yaxis\":\"y\",\"frame\":null}],\"highlight\":{\"on\":\"plotly_click\",\"persistent\":false,\"dynamic\":false,\"selectize\":false,\"opacityDim\":0.2,\"selected\":{\"opacity\":1},\"debounce\":0},\"base_url\":\"https://plot.ly\"},\"evals\":[\"config.modeBarButtonsToAdd.0.click\"],\"jsHooks\":[]}</script>\n<script type=\"application/htmlwidget-sizing\" data-for=\"htmlwidget-c90654175793e51d6612\">{\"viewer\":{\"width\":\"100%\",\"height\":400,\"padding\":15,\"fill\":true},\"browser\":{\"width\":\"100%\",\"height\":400,\"padding\":40,\"fill\":true}}</script>","htmlwidget-head":"{\"stylesheets\":[\"https://widget-cdn.displayr.com/crosstalk-b25ccf47e9892cf2654d5ded8a45d9b7.css\",\"https://widget-cdn.displayr.com/plotly-htmlwidgets-ef6d87e1454c6f9f50a1a5a3e8b42646.css\"],\"javascript\":[\"https://widget-cdn.displayr.com/htmlwidgets-917a66c6e5036eb1bfd1fb672a82635a.js\",\"https://widget-cdn.displayr.com/plotly-c1d49eded87001936f93debf9b25b2d0.js\",\"https://widget-cdn.displayr.com/typedarray.min-830ee97537deb99885d830da3312e14d.js\",\"https://widget-cdn.displayr.com/jquery.min-91a24ea414e8c447d647cecab86866c2.js\",\"https://widget-cdn.displayr.com/crosstalk.min-b1936a0f8f135773de79f3a54af76d20.js\",\"https://widget-cdn.displayr.com/plotly-latest.min-a03b8e00ce1a91ef1a582ba5349a6a60.js\"],\"attachments\":[],\"widget-cannot-re-render\":false,\"package\":\"plotly\",\"package_version\":\"4.8.0\"}"},"secondsTaken":0.5624989,"updated":"2018-12-02T06:18:06.6905799Z","LastUpdatedMessage":null,"executedCode":"IndifferenceCurves <- function(X, x.tick.format = \"\", y.tick.format = \"\", x.reverse = FALSE, y.reverse = FALSE, show.hover = FALSE)\n{\n x.name = names(dimnames(X))[2]\n y.name = names(dimnames(X))[1]\n require(plotly)\n hover = paste0(y.name, \": %s\\n\", x.name, \": %s\\nUtility: %.2f\") \n hover = sprintf(hover, rownames(X), rep(colnames(X), rep(nrow(X), ncol(X))), as.numeric((X)))\n hover = matrix(hover, nrow = nrow(X), byrow = FALSE)\n plot_ly(x = as.numeric(colnames(X)), \n y = as.numeric(rownames(X)), \n z = X, \n type = \"contour\" ,\n text = if(show.hover) hover else NULL, \n hoverinfo = \"text\",\n contours = list(showlabels = TRUE)) %>%\n colorbar(title = \"Utility\") %>% \n config(displayModeBar = F) %>% \n layout(xaxis = list(title = x.name, \n tickformat = x.tick.format, \n tickvals = colnames(X),\n autorange = if (x.reverse) 'reversed' else TRUE), \n yaxis = list(title = y.name,\n tickformat = y.tick.format, \n tickvals = rownames(X),\n autorange = if (y.reverse) 'reversed' else TRUE))\n}\nIndifferenceCurves(indifference.table, y.tick.format = \"$\", x.reverse = TRUE)\n","lastSavedCode":null,"isStandardRItem":false,"highlightedCodeSpans":[{"Range":{"StartLineNumber":27,"StartColumnNumber":20,"EndLineNumber":27,"EndColumnNumber":38},"Reference":"c04265a8-2d52-4e20-8737-75e3ed581ee1","Type":2,"Text":"indifference.table","Color":0}],"tableTransformations":"<TabularTransformer>\r\n <TabularTransform type=\"Truncation\" truncationHeaderType=\"Column\" />\r\n <TabularTransform />\r\n</TabularTransformer>","tabularFilteringOptions":null,"hasGuiControls":false,"calculating":"Idle","showDebug":false,"layout":"CodeOnly","vSplit":0.25,"hSplit":0.45,"Options":{"debugconsole":false,"codeposition":"CodeOnly","splitH":0.45,"splitV":0.25}}