Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
updateData(key: Value, value: Value) {
// console.log('updateData: k: ', key, ' v: ', value);
const sliceColors = [Color.parse("#00a6ed"), Color.parse("#7ed321"),
Color.parse("#c200fb"), Color.parse("#50e3c2"),
Color.parse("#57b8ff"), Color.parse("#5aff15"),
Color.parse("#55dde0"), Color.parse("#f7aef8")];
const tween: Transition = Transition.duration(1000);
const id = key.get("id").stringValue() || '';
const index = key.get("index").numberValue() || 0;
const sliceColor = sliceColors[index % 8];
const sliceValue = value.numberValue() || 0;
const pie = this.pieView;
if (sliceValue > 0) {
let slice: SliceView = pie.getChildView(id) as SliceView;
if (slice) {
slice.value(sliceValue, tween);
// slice.label().text(sliceValue.toFixed());
} else {
slice = new SliceView()
.value(sliceValue)
.sliceColor(sliceColor)
updateData(key: Value, value: Value) {
// console.log('updateData: k: ', key, ' v: ', value);
const sliceColors = [Color.parse("#00a6ed"), Color.parse("#7ed321"),
Color.parse("#c200fb"), Color.parse("#50e3c2"),
Color.parse("#57b8ff"), Color.parse("#5aff15"),
Color.parse("#55dde0"), Color.parse("#f7aef8")];
const tween: Transition = Transition.duration(1000);
const id = key.get("id").stringValue() || '';
const index = key.get("index").numberValue() || 0;
const sliceColor = sliceColors[index % 8];
const sliceValue = value.numberValue() || 0;
const pie = this.pieView;
if (sliceValue > 0) {
let slice: SliceView = pie.getChildView(id) as SliceView;
if (slice) {
slice.value(sliceValue, tween);
// slice.label().text(sliceValue.toFixed());
} else {
updateData(key: Value, value: Value) {
// console.log('updateData: k: ', key, ' v: ', value);
const sliceColors = [Color.parse("#00a6ed"), Color.parse("#7ed321"),
Color.parse("#c200fb"), Color.parse("#50e3c2"),
Color.parse("#57b8ff"), Color.parse("#5aff15"),
Color.parse("#55dde0"), Color.parse("#f7aef8")];
const tween: Transition = Transition.duration(1000);
const id = key.get("id").stringValue() || '';
const index = key.get("index").numberValue() || 0;
const sliceColor = sliceColors[index % 8];
const sliceValue = value.numberValue() || 0;
const pie = this.pieView;
if (sliceValue > 0) {
let slice: SliceView = pie.getChildView(id) as SliceView;
if (slice) {
slice.value(sliceValue, tween);
// slice.label().text(sliceValue.toFixed());
} else {
slice = new SliceView()
get primaryColor(): Color {
return Color.parse("#d90c25");
}
didSetView(view: PopoverView): void {
view.width(240)
.height(360)
.display('flex')
.flexDirection('column')
.borderRadius(5)
.padding(10)
.backgroundColor(Color.parse("#071013").alpha(0.9))
.backdropFilter("blur(2px)")
.color("#ffffff");
const intersection = this._info;
const header = view.append("header")
.display('flex')
.alignItems('center');
header.append("div")
.borderRadius(20)
.backgroundColor('#00a6ed')
.padding([3,6,3,6])
.marginRight(5)
.fontSize(15)
.color("#000000")
.text(`${intersection.id}`);
get: function (this: ColorOrStringAttributeAnimator): Color | string | null | undefined {
let value = this._value;
if (value === void 0) {
const attributeValue = this.attributeValue;
if (attributeValue) {
try {
value = Color.parse(attributeValue);
} catch (swallow) {
value = attributeValue;
}
}
}
return value;
},
enumerable: true,
get: function (this: ColorOrStringStyleAnimator): Color | string | null | undefined {
let value = this._value;
if (value === void 0) {
const propertyValue = this.propertyValue;
if (propertyValue) {
try {
value = Color.parse(propertyValue);
} catch (swallow) {
value = propertyValue;
}
}
}
return value;
},
enumerable: true,
get primaryColor(): Color {
return Color.parse("#c200fa");
}