@@ -21678,6 +21678,17 @@ var IDENTITY = [1,0,0,0,
21678
21678
0,0,1,0,
21679
21679
0,0,0,1]
21680
21680
21681
+ var ab = ArrayBuffer
21682
+ var dv = DataView
21683
+
21684
+ function isTypedArray(a) {
21685
+ return ab.isView(a) && !(a instanceof dv)
21686
+ }
21687
+
21688
+ function isArrayOrTypedArray(a) {
21689
+ return Array.isArray(a) || isTypedArray(a)
21690
+ }
21691
+
21681
21692
module.exports = createPointCloud
21682
21693
21683
21694
function transformMat4(x, m) {
@@ -22065,7 +22076,7 @@ function get_glyphData(glyphs, index, font, pixelRatio) {
22065
22076
var str
22066
22077
22067
22078
// use the data if presented in an array
22068
- if(Array.isArray (glyphs)) {
22079
+ if(isArrayOrTypedArray (glyphs)) {
22069
22080
if(index < glyphs.length) {
22070
22081
str = glyphs[index]
22071
22082
} else {
@@ -22086,19 +22097,19 @@ function get_glyphData(glyphs, index, font, pixelRatio) {
22086
22097
if(!font) font = {}
22087
22098
22088
22099
var family = font.family
22089
- if(Array.isArray (family)) family = family[index]
22100
+ if(isArrayOrTypedArray (family)) family = family[index]
22090
22101
if(!family) family = "normal"
22091
22102
22092
22103
var weight = font.weight
22093
- if(Array.isArray (weight)) weight = weight[index]
22104
+ if(isArrayOrTypedArray (weight)) weight = weight[index]
22094
22105
if(!weight) weight = "normal"
22095
22106
22096
22107
var style = font.style
22097
- if(Array.isArray (style)) style = style[index]
22108
+ if(isArrayOrTypedArray (style)) style = style[index]
22098
22109
if(!style) style = "normal"
22099
22110
22100
22111
var variant = font.variant
22101
- if(Array.isArray (variant)) variant = variant[index]
22112
+ if(isArrayOrTypedArray (variant)) variant = variant[index]
22102
22113
if(!variant) variant = "normal"
22103
22114
22104
22115
var glyph = getGlyph(str, {
@@ -22133,15 +22144,15 @@ proto.update = function(options) {
22133
22144
this.lineWidth = options.lineWidth
22134
22145
}
22135
22146
if('project' in options) {
22136
- if(Array.isArray (options.project)) {
22147
+ if(isArrayOrTypedArray (options.project)) {
22137
22148
this.axesProject = options.project
22138
22149
} else {
22139
22150
var v = !!options.project
22140
22151
this.axesProject = [v,v,v]
22141
22152
}
22142
22153
}
22143
22154
if('projectScale' in options) {
22144
- if(Array.isArray (options.projectScale)) {
22155
+ if(isArrayOrTypedArray (options.projectScale)) {
22145
22156
this.projectScale = options.projectScale.slice()
22146
22157
} else {
22147
22158
var s = +options.projectScale
@@ -22151,7 +22162,7 @@ proto.update = function(options) {
22151
22162
22152
22163
this.projectHasAlpha = false // default to no transparent draw
22153
22164
if('projectOpacity' in options) {
22154
- if(Array.isArray (options.projectOpacity)) {
22165
+ if(isArrayOrTypedArray (options.projectOpacity)) {
22155
22166
this.projectOpacity = options.projectOpacity.slice()
22156
22167
} else {
22157
22168
var s = +options.projectOpacity
@@ -22262,8 +22273,8 @@ proto.update = function(options) {
22262
22273
var color = [0,0,0,1]
22263
22274
var lineColor = [0,0,0,1]
22264
22275
22265
- var isColorArray = Array.isArray (colors) && Array.isArray (colors[0])
22266
- var isLineColorArray = Array.isArray (lineColors) && Array.isArray (lineColors[0])
22276
+ var isColorArray = isArrayOrTypedArray (colors) && isArrayOrTypedArray (colors[0])
22277
+ var isLineColorArray = isArrayOrTypedArray (lineColors) && isArrayOrTypedArray (lineColors[0])
22267
22278
22268
22279
fill_loop:
22269
22280
for(var i=0; i<numPoints; ++i) {
@@ -22289,7 +22300,7 @@ proto.update = function(options) {
22289
22300
22290
22301
//Get color
22291
22302
if(!glyphVisible) color = [1,1,1,0]
22292
- else if(Array.isArray (colors)) {
22303
+ else if(isArrayOrTypedArray (colors)) {
22293
22304
var c
22294
22305
if(isColorArray) {
22295
22306
if(i < colors.length) {
@@ -22320,7 +22331,7 @@ proto.update = function(options) {
22320
22331
22321
22332
//Get lineColor
22322
22333
if(!glyphVisible) lineColor = [1,1,1,0]
22323
- else if(Array.isArray (lineColors)) {
22334
+ else if(isArrayOrTypedArray (lineColors)) {
22324
22335
var c
22325
22336
if(isLineColorArray) {
22326
22337
if(i < lineColors.length) {
@@ -22351,7 +22362,7 @@ proto.update = function(options) {
22351
22362
22352
22363
var size = 0.5
22353
22364
if(!glyphVisible) size = 0.0
22354
- else if(Array.isArray (sizes)) {
22365
+ else if(isArrayOrTypedArray (sizes)) {
22355
22366
if(i < sizes.length) {
22356
22367
size = +sizes[i]
22357
22368
} else {
@@ -22365,7 +22376,7 @@ proto.update = function(options) {
22365
22376
22366
22377
22367
22378
var angle = 0
22368
- if(Array.isArray (angles)) {
22379
+ if(isArrayOrTypedArray (angles)) {
22369
22380
if(i < angles.length) {
22370
22381
angle = +angles[i]
22371
22382
} else {
@@ -22390,7 +22401,7 @@ proto.update = function(options) {
22390
22401
var textOffsetY = alignmentY
22391
22402
22392
22403
var textOffsetX = 0
22393
- if(Array.isArray (alignmentX)) {
22404
+ if(isArrayOrTypedArray (alignmentX)) {
22394
22405
if(i < alignmentX.length) {
22395
22406
textOffsetX = alignmentX[i]
22396
22407
} else {
@@ -22401,7 +22412,7 @@ proto.update = function(options) {
22401
22412
}
22402
22413
22403
22414
var textOffsetY = 0
22404
- if(Array.isArray (alignmentY)) {
22415
+ if(isArrayOrTypedArray (alignmentY)) {
22405
22416
if(i < alignmentY.length) {
22406
22417
textOffsetY = alignmentY[i]
22407
22418
} else {
0 commit comments