Title: how to define Args parameter for UpdateMenuButton.init for release version 5.0 · plotly/Plotly.NET · Discussion #456 · GitHub
Open Graph Title: how to define Args parameter for UpdateMenuButton.init for release version 5.0 · plotly/Plotly.NET · Discussion #456
X Title: how to define Args parameter for UpdateMenuButton.init for release version 5.0 · plotly/Plotly.NET · Discussion #456
Description: how to define Args parameter for UpdateMenuButton.init for release version 5.0
Open Graph Description: Following code doesn't compile anymore with release 5.0: UpdateMenuButton.init(Args: new string[] { "mode", "lines"}, Label: "Lines", Method: UpdateMethod.Restyle) Args with string[] is no longer v...
X Description: Following code doesn't compile anymore with release 5.0: UpdateMenuButton.init(Args: new string[] { "mode", "lines"}, Label: "Lines", Method: UpdateMethod.Restyle)...
Opengraph URL: https://github.com/plotly/Plotly.NET/discussions/456
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"QAPage","mainEntity":{"@type":"Question","name":"how to define Args parameter for UpdateMenuButton.init for release version 5.0","text":"Following code doesn't compile anymore with release 5.0:
\nUpdateMenuButton.init(Args: new string[] { \"mode\", \"lines\"}, Label: \"Lines\", Method: UpdateMethod.Restyle)
\nArgs with string[] is no longer valid.
\nHow to define args with release 5.0?
","upvoteCount":1,"answerCount":1,"acceptedAnswer":{"@type":"Answer","text":"Hi @kunjiangkun,
\nThe original intention of changing the argument type to DynamicObj[] was to support arguments of different types (see #414), because in the final schema, args is a json array with arbitrary types.
\nThis means that you now have to create dynamic objects with field names set to your argument names. Here is a simple example:
\nusing Plotly.NET;\nusing Plotly.NET.LayoutObjects;\nusing DynamicObj;\n\nvar mode1 = new DynamicObj.DynamicObj();\nmode1.SetValue(\"mode\", \"markers\");\n\nvar mode2 = new DynamicObj.DynamicObj();\nmode2.SetValue(\"mode\", \"lines\");\n\nvar myBtn1 = UpdateMenuButton.init(\n Args: new DynamicObj.DynamicObj[] {mode1}, Label: \"Markers\", Method: StyleParam.UpdateMethod.Restyle);\n\nvar myBtn2 = UpdateMenuButton.init(\n Args: new DynamicObj.DynamicObj[] {mode2}, Label: \"Lines\", Method: StyleParam.UpdateMethod.Restyle);\n\nChart2D.Chart.Point<int,int,string>(\n x: new[] {1, 2, 3, 4},\n y: new[] {10, 11, 12, 13}\n)\n.WithUpdateMenu(UpdateMenu.init(Buttons: new UpdateMenuButton[] {myBtn1, myBtn2}))
","upvoteCount":1,"url":"https://github.com/plotly/Plotly.NET/discussions/456#discussioncomment-9673918"}}}
| route-pattern | /:user_id/:repository/discussions/:number(.:format) |
| route-controller | discussions |
| route-action | show |
| fetch-nonce | v2:2b7d31df-225a-abde-e35e-07e275179789 |
| current-catalog-service-hash | 9f0abe34da433c9b6db74bffa2466494a717b579a96b30a5d252e5090baea7be |
| request-id | B856:140A92:2FB7EE:41A0B5:698F4CE1 |
| html-safe-nonce | 2292bd0ccb9a03f331be13b456472ace5965d540d246b2b2a71f585df3291b74 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODU2OjE0MEE5MjoyRkI3RUU6NDFBMEI1OjY5OEY0Q0UxIiwidmlzaXRvcl9pZCI6IjkxNDMzNzA2MzE5OTA5NTUyMzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | febbf001badd3fc65e5b9c8299c2127001658b01a71fcf674fe729fb04d6101a |
| hovercard-subject-tag | discussion:6778285 |
| github-keyboard-shortcuts | repository,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/plotly/Plotly.NET/discussions/456 |
| twitter:image | https://opengraph.githubassets.com/6a27fc4df305ad6733858055b3ed9eeeccd6610a7d1c72acf3ed5f7b6cb8c6c0/plotly/Plotly.NET/discussions/456 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6a27fc4df305ad6733858055b3ed9eeeccd6610a7d1c72acf3ed5f7b6cb8c6c0/plotly/Plotly.NET/discussions/456 |
| og:image:alt | Following code doesn't compile anymore with release 5.0: UpdateMenuButton.init(Args: new string[] { "mode", "lines"}, Label: "Lines", Method: UpdateMethod.Restyle) Args with string[] is no longer v... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6102991c714c1a6a27d05fb4f96ea6ca87a6750b4f093b95cc57ed1b84b145a1 |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/Plotly.NET git https://github.com/plotly/Plotly.NET.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 58708375 |
| octolytics-dimension-repository_nwo | plotly/Plotly.NET |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 58708375 |
| octolytics-dimension-repository_network_root_nwo | plotly/Plotly.NET |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 6a0e76b4dbdd86599b4b518abe0e57175194496e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width