Title: [BUG]: image zmin/zmax reject 3-element arrays for rgb/hsl colormodels · Issue #8182 · plotly/plotly.js · GitHub
Open Graph Title: [BUG]: image zmin/zmax reject 3-element arrays for rgb/hsl colormodels · Issue #8182 · plotly/plotly.js
X Title: [BUG]: image zmin/zmax reject 3-element arrays for rgb/hsl colormodels · Issue #8182 · plotly/plotly.js
Description: Description For image traces, zmin/zmax are defined as 4-element info_arrays in src/traces/image/attributes.ts, so Plotly.validate rejects 3-element arrays. But the rgb and hsl colormodels only have 3 components — src/traces/image/consta...
Open Graph Description: Description For image traces, zmin/zmax are defined as 4-element info_arrays in src/traces/image/attributes.ts, so Plotly.validate rejects 3-element arrays. But the rgb and hsl colormodels only hav...
X Description: Description For image traces, zmin/zmax are defined as 4-element info_arrays in src/traces/image/attributes.ts, so Plotly.validate rejects 3-element arrays. But the rgb and hsl colormodels only hav...
Opengraph URL: https://github.com/plotly/plotly.js/issues/8182
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[BUG]: image zmin/zmax reject 3-element arrays for rgb/hsl colormodels","articleBody":"Description\nFor image traces, `zmin`/`zmax` are defined as 4-element `info_array`s in `src/traces/image/attributes.ts`, so `Plotly.validate` rejects 3-element arrays. But the `rgb` and `hsl` colormodels only have 3 components — `src/traces/image/constants.ts` defines 3-element min/max for them — and the plotly.py side (whose validators are generated from this schema) raises a `ValueError` for `zmin=[10,10,10]` with `colormodel='rgb'` (plotly/plotly.py#1973). KoolADE85 confirmed on 2026-11-09 that the fix belongs in plotly.js and invited a PR here.\n\nSteps to reproduce\n```js\nPlotly.validate([{type: 'image', z: [[[1, 1, 1]]], colormodel: 'rgb', zmin: [10, 10, 10], zmax: [100, 100, 100]}])\n```\nThis rejects the 3-element arrays, while 4-element arrays pass. In plotly.py the same input raises `ValueError` saying `zmax` must be a list or tuple of 4 elements.\n\nNotes\nI checked the repo's own `src/lib/coerce.js` `info_array` validate function: with the current schema `validate([10,10,10])` is `false`; adding `freeLength: true` to `zmin`/`zmax` in `attributes.ts` makes it `true`, while 4-element arrays and non-numeric rejection are unchanged. The intended fix is that change plus `npm run schema` regeneration and a jasmine test.\n\nOne boundary to decide: with `freeLength` plus array `items`, an input longer than 4 elements throws a TypeError inside `validate` (because `items[4]` is undefined) — the same shape already exists for parcoords `constraintrange`. The alternative is a single-object `items` (`{valType: 'number'}`) plus `freeLength`, which would not throw but changes the generated schema types more. Which form would you prefer? Once approved here I'll open the PR.","author":{"url":"https://github.com/DresdenGman","@type":"Person","name":"DresdenGman"},"datePublished":"2026-11-20T14:25:10Z","url":"https://github.com/plotly/plotly.js/issues/8182"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:eb46a47c-2fd8-1cad-ea28-54d2dc2da343 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 98B2:313081:85B9FE:B031E9:6B01ADF9 |
| html-safe-nonce | 6c083a1c5f4bcb7211eba6e857bf5ad3125dbe4b0f42ca3b962d467436ef7b8e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEIyOjMxMzA4MTo4NUI5RkU6QjAzMUU5OjZCMDFBREY5IiwidmlzaXRvcl9pZCI6IjMzMjQyOTkyOTg3MTUzMTU3MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f27a0b91c917a1474e2e3db2389bba3a91e56f88a3cb7f45ecb46ea6ee2887fb |
| hovercard-subject-tag | issue:6513314118 |
| github-keyboard-shortcuts | repository,issues,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/_view_fragments/issues/show/plotly/plotly.js/8182/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9c4a7e5cf5bad487dbf7e54682451152c84cfd0c1e80ad094ba4d265c6588006/plotly/plotly.js/issues/8182 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9c4a7e5cf5bad487dbf7e54682451152c84cfd0c1e80ad094ba4d265c6588006/plotly/plotly.js/issues/8182 |
| og:image:alt | Description For image traces, zmin/zmax are defined as 4-element info_arrays in src/traces/image/attributes.ts, so Plotly.validate rejects 3-element arrays. But the rgb and hsl colormodels only hav... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | DresdenGman |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/plotly/plotly.js git https://github.com/plotly/plotly.js.git |
| octolytics-dimension-user_id | 5997976 |
| octolytics-dimension-user_login | plotly |
| octolytics-dimension-repository_id | 45646037 |
| octolytics-dimension-repository_nwo | plotly/plotly.js |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 45646037 |
| octolytics-dimension-repository_network_root_nwo | plotly/plotly.js |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width