本文整理匯總了TypeScript中@hpcc-js/common.Palette.rainbow方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Palette.rainbow方法的具體用法?TypeScript Palette.rainbow怎麽用?TypeScript Palette.rainbow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@hpcc-js/common.Palette
的用法示例。
在下文中一共展示了Palette.rainbow方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: IChoropleth
import { Palette } from "@hpcc-js/common";
export function IChoropleth() {
}
IChoropleth.prototype._palette = Palette.rainbow("default");
// Events ---
IChoropleth.prototype.click = function (row, column, selected) {
console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
};
示例2: I2DAggrChart
import { Palette } from "@hpcc-js/common";
import { hsl as d3Hsl } from "d3-color";
export function I2DAggrChart() {
}
I2DAggrChart.prototype._palette = Palette.rainbow("default");
I2DAggrChart.prototype.fillColor = function (row: any[][], column, value): string {
return this._palette(row.length);
};
I2DAggrChart.prototype.strokeColor = function (row: any[][], column, value): string {
return d3Hsl(this.fillColor(row, column, value)).darker().toString();
};
I2DAggrChart.prototype.textColor = function (row: any[][], column, value): string {
return Palette.textColor(this.fillColor(row, column, value));
};
// Events ---
I2DAggrChart.prototype.click = function (row: object[], column, selected) {
console.log("Click: " + JSON.stringify(row) + ", " + column + ", " + selected);
};
I2DAggrChart.prototype.dblclick = function (row: object[], column, selected) {
console.log("Double click: " + JSON.stringify(row) + ", " + column + ", " + selected);
};