From 219bfee7503856b1395b37504a6a609ccbe8fc09 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Thu, 19 May 2022 16:51:37 -0400 Subject: [PATCH 1/3] mention log and date info on shapes.yref similar to xref --- src/components/shapes/attributes.js | 4 ++++ test/plot-schema.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/shapes/attributes.js b/src/components/shapes/attributes.js index 9b81133d150..dd4b6eb8fbf 100644 --- a/src/components/shapes/attributes.js +++ b/src/components/shapes/attributes.js @@ -109,6 +109,10 @@ module.exports = templatedArray('shape', { description: [ 'Sets the annotation\'s y coordinate axis.', axisPlaceableObjs.axisRefDescription('y', 'bottom', 'top'), + 'If the axis `type` is *log*, then you must take the', + 'log of your desired range.', + 'If the axis `type` is *date*, then you must convert', + 'the date to unix time in milliseconds.' ].join(' ') }), ysizemode: { diff --git a/test/plot-schema.json b/test/plot-schema.json index 9cf4bbd1950..f05ed5e79cd 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -7009,7 +7009,7 @@ "valType": "any" }, "yref": { - "description": "Sets the annotation's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top). If set to a y axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., *y2 domain* refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis.", + "description": "Sets the annotation's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top). If set to a y axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., *y2 domain* refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, then you must convert the date to unix time in milliseconds.", "editType": "calc", "valType": "enumerated", "values": [ From f345c2e8a267a5a6cab8090dec0bf4ac51d16e17 Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Wed, 25 May 2022 09:25:58 -0400 Subject: [PATCH 2/3] fix shapes.(x|y)ref descriptions --- src/components/shapes/attributes.js | 12 ++---------- test/plot-schema.json | 4 ++-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/components/shapes/attributes.js b/src/components/shapes/attributes.js index dd4b6eb8fbf..437952415f9 100644 --- a/src/components/shapes/attributes.js +++ b/src/components/shapes/attributes.js @@ -53,11 +53,7 @@ module.exports = templatedArray('shape', { xref: extendFlat({}, annAttrs.xref, { description: [ 'Sets the shape\'s x coordinate axis.', - axisPlaceableObjs.axisRefDescription('x', 'left', 'right'), - 'If the axis `type` is *log*, then you must take the', - 'log of your desired range.', - 'If the axis `type` is *date*, then you must convert', - 'the date to unix time in milliseconds.' + axisPlaceableObjs.axisRefDescription('x', 'left', 'right') ].join(' ') }), xsizemode: { @@ -108,11 +104,7 @@ module.exports = templatedArray('shape', { yref: extendFlat({}, annAttrs.yref, { description: [ 'Sets the annotation\'s y coordinate axis.', - axisPlaceableObjs.axisRefDescription('y', 'bottom', 'top'), - 'If the axis `type` is *log*, then you must take the', - 'log of your desired range.', - 'If the axis `type` is *date*, then you must convert', - 'the date to unix time in milliseconds.' + axisPlaceableObjs.axisRefDescription('y', 'bottom', 'top') ].join(' ') }), ysizemode: { diff --git a/test/plot-schema.json b/test/plot-schema.json index f05ed5e79cd..dc158f4f64a 100644 --- a/test/plot-schema.json +++ b/test/plot-schema.json @@ -6975,7 +6975,7 @@ "valType": "any" }, "xref": { - "description": "Sets the shape's x coordinate axis. If set to a x axis id (e.g. *x* or *x2*), the `x` position refers to a x coordinate. If set to *paper*, the `x` position refers to the distance from the left of the plotting area in normalized coordinates where *0* (*1*) corresponds to the left (right). If set to a x axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., *x2 domain* refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, then you must convert the date to unix time in milliseconds.", + "description": "Sets the shape's x coordinate axis. If set to a x axis id (e.g. *x* or *x2*), the `x` position refers to a x coordinate. If set to *paper*, the `x` position refers to the distance from the left of the plotting area in normalized coordinates where *0* (*1*) corresponds to the left (right). If set to a x axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the left of the domain of that axis: e.g., *x2 domain* refers to the domain of the second x axis and a x position of 0.5 refers to the point between the left and the right of the domain of the second x axis.", "editType": "calc", "valType": "enumerated", "values": [ @@ -7009,7 +7009,7 @@ "valType": "any" }, "yref": { - "description": "Sets the annotation's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top). If set to a y axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., *y2 domain* refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis. If the axis `type` is *log*, then you must take the log of your desired range. If the axis `type` is *date*, then you must convert the date to unix time in milliseconds.", + "description": "Sets the annotation's y coordinate axis. If set to a y axis id (e.g. *y* or *y2*), the `y` position refers to a y coordinate. If set to *paper*, the `y` position refers to the distance from the bottom of the plotting area in normalized coordinates where *0* (*1*) corresponds to the bottom (top). If set to a y axis ID followed by *domain* (separated by a space), the position behaves like for *paper*, but refers to the distance in fractions of the domain length from the bottom of the domain of that axis: e.g., *y2 domain* refers to the domain of the second y axis and a y position of 0.5 refers to the point between the bottom and the top of the domain of the second y axis.", "editType": "calc", "valType": "enumerated", "values": [ From 81d24db35b1b98de03ff5a5d9480fc7d0fe0d4cf Mon Sep 17 00:00:00 2001 From: Mojtaba Samimi Date: Wed, 25 May 2022 09:28:29 -0400 Subject: [PATCH 3/3] draft log for PR 6194 --- draftlogs/6194_fix.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 draftlogs/6194_fix.md diff --git a/draftlogs/6194_fix.md b/draftlogs/6194_fix.md new file mode 100644 index 00000000000..88cb978d373 --- /dev/null +++ b/draftlogs/6194_fix.md @@ -0,0 +1 @@ + - Fix `xref` description of `shapes` [[#6194](https://github.com/plotly/plotly.js/pull/6194)]