Skip to content

Commit

Permalink
add selectionColor, onClick to catalog parameters handled by updateShape
Browse files Browse the repository at this point in the history
  • Loading branch information
simontorres authored and bmatthieu3 committed Oct 9, 2024
1 parent af9fd4e commit 9100d97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/Catalog.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,15 +488,19 @@ export let Catalog = (function () {
*
* @param {Object} [options] - shape options
* @param {string} [options.color] - the color of the shape
* @param {string} [options.selectionColor] - the color of the shape when selected
* @param {number} [options.sourceSize] - size of the shape
* @param {string|Function|HTMLImageCanvas|HTMLImageElement} [options.shape="square"] - the type of the shape. Can be square, rhomb, plus, cross, triangle, circle.
* A callback function can also be called that return an HTMLImageElement in function of the source object. A canvas or an image can also be given.
* @param {string|Function} [options.onClick] - Whether the source data appears as a table row or a in popup. Can be 'showTable' string, 'showPopup' string or a custom user defined function that handles the click.
*/
Catalog.prototype.updateShape = function (options) {
options = options || {};
this.color = options.color || this.color || Color.getNextColor();
this.selectionColor = options.selectionColor || this.selectionColor || Color.getNextColor();
this.sourceSize = options.sourceSize || this.sourceSize || 6;
this.shape = options.shape || this.shape || "square";
this.onClick = options.onClick || this.onClick;

this._shapeIsFunction = false; // if true, the shape is a function drawing on the canvas
this._shapeIsFootprintFunction = false;
Expand Down Expand Up @@ -796,7 +800,7 @@ export let Catalog = (function () {
};

/**
* Set the color of the catalog
* Set the shape of the catalog sources
*
* @memberof Catalog
*
Expand Down

0 comments on commit 9100d97

Please sign in to comment.