Initial commit 2.0 beta 0

This commit is contained in:
2022-10-04 10:51:35 +02:00
parent f87b19140b
commit c5c2759ebd
70 changed files with 60593 additions and 62354 deletions
+4 -4
View File
@@ -71,7 +71,7 @@ export default class AbstractPopup extends PIXI.Graphics {
radius: theme.radius,
onHidden: null,
visible: true,
orientation: null
orientation: null,
},
opts
)
@@ -105,7 +105,7 @@ export default class AbstractPopup extends PIXI.Graphics {
// interaction
//-----------------
this.interactive = true
this.on('added', e => {
this.on('added', (e) => {
this.show()
})
}
@@ -285,7 +285,7 @@ export default class AbstractPopup extends PIXI.Graphics {
if (cb) {
cb.call(this)
}
}
},
})
return this
@@ -305,7 +305,7 @@ export default class AbstractPopup extends PIXI.Graphics {
if (cb) {
cb.call(this)
}
}
},
})
if (this.opts.onHidden) {
+1 -1
View File
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" style="max-width: none;">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+2 -4
View File
@@ -8,10 +8,8 @@
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
<link rel="stylesheet" href="../../css/doctest.css">
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
<script src=".././3rdparty/all.js"></script>
<script src=".../../dist/iwmlib.pixi.js"></script>
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
<script src="../../dist/iwmlib.3rdparty.js"></script>
<script src="../../dist/iwmlib.pixi.js"></script>
<style>
+15 -15
View File
@@ -50,21 +50,21 @@ const app = new PIXIApp({
app.setup()
app.run()
let highlightBtn = new PIXI.Graphics();
highlightBtn.lineStyle(2, 0x033792);
highlightBtn.drawRoundedRect(15, 40, 30, 30, 10);
highlightBtn.endFill();
app.stage.addChild(highlightBtn);
// let highlightBtn = new PIXI.Graphics();
// highlightBtn.lineStyle(2, 0x033792);
// highlightBtn.drawRoundedRect(15, 40, 30, 30, 10);
// highlightBtn.endFill();
// app.stage.addChild(highlightBtn);
// app.loadSprites("assets/app-circle.png", sprites => {
// let circle = sprites.get("assets/app-circle.png")
// circle.anchor.set(0.5)
// circle.x = app.screen.width / 2
// circle.y = app.screen.height / 2
// circle.width = 80
// circle.height = 80
// app.scene.addChild(circle)
// app.run()
// })
app.loadSprites("assets/app-circle.png", sprites => {
let circle = sprites.get("assets/app-circle.png")
circle.anchor.set(0.5)
circle.x = app.screen.width / 2
circle.y = app.screen.height / 2
circle.width = 80
circle.height = 80
app.scene.addChild(circle)
app.run()
})
</script>
</body>
+14 -14
View File
@@ -16,11 +16,11 @@ import { debounce } from '../utils.js'
*
* @private
* @class
* @extends PIXI.interaction.InteractionManager
* @extends PIXI.InteractionManager
* @see {@link http://pixijs.download/dev/docs/PIXI.interaction.InteractionManager.html|PIXI.interaction.InteractionManager}
* @see {@link https://stackoverflow.com/questions/29710696/webgl-drawing-buffer-size-does-not-equal-canvas-size}
*/
class FullscreenInteractionManager extends PIXI.interaction.InteractionManager {
class FullscreenInteractionManager extends PIXI.InteractionManager {
mapPositionToPoint(point, x, y) {
let resolution = this.renderer.resolution
let extendWidth = 1.0
@@ -98,7 +98,7 @@ export default class PIXIApp extends PIXI.Application {
roundPixels = true,
monkeyPatchMapping = true,
adaptive = true,
graphql = false
graphql = false,
}) {
const fullScreen = !width || !height
@@ -111,12 +111,12 @@ export default class PIXIApp extends PIXI.Application {
view,
width,
height,
transparent,
backgroundAlpha: transparent,
antialias,
resolution,
autoResize,
backgroundColor,
forceCanvas
forceCanvas,
})
this.width = width
@@ -137,7 +137,7 @@ export default class PIXIApp extends PIXI.Application {
this.graphql = graphql
if (fullScreen || autoResize) {
console.log('App is in fullScreen mode or autoResize mode')
const resizeDebounced = debounce(event => this.resizeApp(event), 50)
const resizeDebounced = debounce((event) => this.resizeApp(event), 50)
window.addEventListener('resize', resizeDebounced)
document.body.addEventListener('orientationchange', this.checkOrientation.bind(this))
}
@@ -167,25 +167,25 @@ export default class PIXIApp extends PIXI.Application {
// GraphQL
if (this.graphql && typeof apollo !== 'undefined') {
const networkInterface = apollo.createNetworkInterface({
uri: '/graphql'
uri: '/graphql',
})
const wsClient = new subscriptions.SubscriptionClient(`wss://${location.hostname}/subscriptions`, {
reconnect: true,
connectionParams: {}
connectionParams: {},
})
const networkInterfaceWithSubscriptions = subscriptions.addGraphQLSubscriptions(networkInterface, wsClient)
this.apolloClient = new apollo.ApolloClient({
networkInterface: networkInterfaceWithSubscriptions
networkInterface: networkInterfaceWithSubscriptions,
})
}
// progress
this._progress = new Progress(
Object.assign({ theme: this.theme }, this.progressOpts, {
app: this
app: this,
})
)
this._progress.visible = false
@@ -214,7 +214,7 @@ export default class PIXIApp extends PIXI.Application {
if (value != this.orient) {
setTimeout(
100,
function() {
function () {
this.orientationChanged(true)
}.bind(this)
)
@@ -469,7 +469,7 @@ export default class PIXIApp extends PIXI.Application {
loadSprites(resources, loaded = null, { resolutionDependent = true, progress = false } = {}) {
this.loadTextures(
resources,
textures => {
(textures) => {
let sprites = new Map()
for (let [key, texture] of textures) {
@@ -528,7 +528,7 @@ export default class PIXIApp extends PIXI.Application {
}
if (progress) {
loader.on('progress', e => {
loader.on('progress', (e) => {
this.progress(e.progress)
})
}
@@ -719,7 +719,7 @@ class FpsDisplay extends PIXI.Graphics {
fontWeight: 'bold',
fill: '#f6f6f6',
stroke: '#434f4f',
strokeThickness: 3
strokeThickness: 3,
})
)
this.text.position.set(6, 6)
+1 -1
View File
@@ -11,7 +11,7 @@
<script src="../../dist/iwmlib.pixi.js"></script>
</head>
<body>
<h1>PIXI.Application with nothing!</h1>
<h1>Vanilla PIXI.Application</h1>
<script>
const app = new PIXI.Application({
+2 -2
View File
@@ -50,7 +50,7 @@ export default class Badge extends AbstractPopup {
minWidth: 0,
minHeight: 0,
padding: theme.padding / 2,
tooltip: null
tooltip: null,
},
opts
)
@@ -84,7 +84,7 @@ export default class Badge extends AbstractPopup {
if (typeof this.opts.tooltip === 'string') {
this.tooltip = new Tooltip({
object: this,
content: this.opts.tooltip
content: this.opts.tooltip,
})
} else {
this.opts.tooltip = Object.assign({}, { object: this }, this.opts.tooltip)
+2 -2
View File
@@ -93,7 +93,7 @@ export default class BlurFilter extends PIXI.Filter {
x: value.x,
y: value.y,
width: value.width,
height: value.height
height: value.height,
}
} else {
const bounds = value.getBounds()
@@ -102,7 +102,7 @@ export default class BlurFilter extends PIXI.Filter {
x: bounds.x,
y: bounds.y,
width: bounds.width,
height: bounds.height
height: bounds.height,
}
}
+2 -2
View File
@@ -76,7 +76,7 @@ import Mercator from './maps/projections/mercator.js'
import Robinson from './maps/projections/robinson.js'
window.Projection = {
Mercator,
Robinson
Robinson,
}
import MapViewport from './maps/mapviewport.js'
@@ -91,7 +91,7 @@ import {
RigidContainer,
CompactScatter,
CoverScatter,
MapObjectScatter
MapObjectScatter,
} from './maps/scatter.js'
window.AdvancedScatterContainer = AdvancedScatterContainer
+12 -12
View File
@@ -156,7 +156,7 @@ export default class Button extends PIXI.Container {
verticalAlign: 'middle',
tooltip: null,
badge: null,
visible: true
visible: true,
},
opts
)
@@ -177,7 +177,7 @@ export default class Button extends PIXI.Container {
strokeAlpha: this.HIDDEN_ALPHA,
strokeActiveAlpha: this.HIDDEN_ALPHA,
fillAlpha: this.HIDDEN_ALPHA,
fillActiveAlpha: this.HIDDEN_ALPHA
fillActiveAlpha: this.HIDDEN_ALPHA,
})
}
@@ -249,15 +249,15 @@ export default class Button extends PIXI.Container {
// interaction
//-----------------
this.button.on('pointerover', e => {
this.button.on('pointerover', (e) => {
this.capture(e)
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 0.83,
overwrite: 'none'
overwrite: 'none',
})
})
this.button.on('pointermove', e => {
this.button.on('pointermove', (e) => {
this.capture(e)
})
@@ -268,17 +268,17 @@ export default class Button extends PIXI.Container {
this.button.on('scroll', this.onEnd.bind(this))
// eslint-disable-next-line no-unused-vars
this.button.on('pointerdown', e => {
this.button.on('pointerdown', (e) => {
//this.capture(e)
this.__start.x = e.data.global.x
this.__start.y = e.data.global.y
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 0.7,
overwrite: 'none'
overwrite: 'none',
})
})
this.button.on('pointerup', e => {
this.button.on('pointerup', (e) => {
this.capture(e)
const distance = Points.distance(e.data.global, this.__start)
@@ -290,7 +290,7 @@ export default class Button extends PIXI.Container {
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 0.83,
overwrite: 'none'
overwrite: 'none',
})
if (this.opts.type === 'checkbox') {
@@ -321,7 +321,7 @@ export default class Button extends PIXI.Container {
if (typeof this.opts.tooltip === 'string') {
this.tooltip = new Tooltip({
object: this,
content: this.opts.tooltip
content: this.opts.tooltip,
})
} else {
this.opts.tooltip = Object.assign({}, { object: this }, this.opts.tooltip)
@@ -338,7 +338,7 @@ export default class Button extends PIXI.Container {
align: 'right',
verticalAlign: 'top',
offsetLeft: 0,
offsetTop: 0
offsetTop: 0,
}
)
if (typeof this.opts.badge === 'string') {
@@ -716,7 +716,7 @@ export default class Button extends PIXI.Container {
this.capture(event)
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 1,
overwrite: 'none'
overwrite: 'none',
})
}
}
+16 -16
View File
@@ -126,7 +126,7 @@ export default class ButtonGroup extends PIXI.Container {
orientation: 'horizontal',
align: 'center', // left, center, right
verticalAlign: 'middle', // top, middle, bottom
visible: true
visible: true,
},
opts
)
@@ -216,7 +216,7 @@ export default class ButtonGroup extends PIXI.Container {
it.verticalAlign = it.verticalAlign || this.opts.verticalAlign
it.afterAction = (event, button) => {
if (this.opts.type === 'radio' && button.opts.type === 'default') {
this.buttons.forEach(it => {
this.buttons.forEach((it) => {
if (it.opts.type === 'default') {
it.active = false
}
@@ -243,7 +243,7 @@ export default class ButtonGroup extends PIXI.Container {
button.__originalPosition = {
x: button.x,
y: button.y
y: button.y,
}
position += (this.opts.orientation === 'horizontal' ? button.width : button.height) + this.opts.margin
@@ -255,7 +255,7 @@ export default class ButtonGroup extends PIXI.Container {
if (this.opts.orientation === 'vertical') {
const maxWidth = this.getMaxButtonWidth()
this.buttons.forEach(it => {
this.buttons.forEach((it) => {
it.opts.minWidth = maxWidth
it.layout()
})
@@ -283,7 +283,7 @@ export default class ButtonGroup extends PIXI.Container {
//--------------------
if (this.opts.app) {
const app = this.opts.app
app.view.addEventListener('mousewheel', event => {
app.view.addEventListener('mousewheel', (event) => {
const bounds = this.getBounds()
const x = event.clientX - app.view.getBoundingClientRect().left
const y = event.clientY - app.view.getBoundingClientRect().top
@@ -338,7 +338,7 @@ export default class ButtonGroup extends PIXI.Container {
*/
draw() {
if (this.opts.margin === 0) {
this.buttons.forEach(it => it.hide())
this.buttons.forEach((it) => it.hide())
this.container.clear()
this.container.lineStyle(this.opts.strokeWidth, this.opts.stroke, this.opts.strokeAlpha)
@@ -378,7 +378,7 @@ export default class ButtonGroup extends PIXI.Container {
set disabled(value) {
this._disabled = value
this.buttons.forEach(it => (it.disabled = value))
this.buttons.forEach((it) => (it.disabled = value))
}
/**
@@ -416,7 +416,7 @@ export default class ButtonGroup extends PIXI.Container {
* @return {number} The maximum with of a button of the button group.
*/
getMaxButtonWidth() {
let widths = this.buttons.map(it => it.width)
let widths = this.buttons.map((it) => it.width)
return Math.max(...widths)
}
@@ -459,7 +459,7 @@ export default class ButtonGroup extends PIXI.Container {
this.__delta = {
x: this.container.position.x - event.data.global.x,
y: this.container.position.y - event.data.global.y
y: this.container.position.y - event.data.global.y,
}
TweenLite.killTweensOf(this.container.position, { x: true, y: true })
@@ -539,7 +539,7 @@ export default class ButtonGroup extends PIXI.Container {
throwProps,
ease: Strong.easeOut,
onUpdate: () => this.stack(),
onComplete: () => ThrowPropsPlugin.untrack(this.container.position)
onComplete: () => ThrowPropsPlugin.untrack(this.container.position),
},
0.8,
0.4
@@ -635,8 +635,8 @@ export default class ButtonGroup extends PIXI.Container {
sorted.push(it)
})
const min = Math.min(...sorted.map(it => it.x))
const max = Math.max(...sorted.map(it => it.x + it.button.width))
const min = Math.min(...sorted.map((it) => it.x))
const max = Math.max(...sorted.map((it) => it.x + it.button.width))
const center = (min + max) / 2
// z-index
@@ -661,7 +661,7 @@ export default class ButtonGroup extends PIXI.Container {
return 0
})
.forEach(it => it.parent.addChild(it))
.forEach((it) => it.parent.addChild(it))
}
/**
@@ -692,8 +692,8 @@ export default class ButtonGroup extends PIXI.Container {
sorted.push(it)
})
const min = Math.min(...sorted.map(it => it.y))
const max = Math.max(...sorted.map(it => it.y + it.button.height))
const min = Math.min(...sorted.map((it) => it.y))
const max = Math.max(...sorted.map((it) => it.y + it.button.height))
const center = (min + max) / 2
// z-index
@@ -718,6 +718,6 @@ export default class ButtonGroup extends PIXI.Container {
return 0
})
.forEach(it => it.parent.addChild(it))
.forEach((it) => it.parent.addChild(it))
}
}
+12 -12
View File
@@ -155,7 +155,7 @@ export class DeepZoomInfo {
this.baseURL = this.urlForTile(this.baseLevel, 0, 0, false)
if (loadBaseImage) {
this.imageForURL(this.baseURL, e => {
this.imageForURL(this.baseURL, (e) => {
this.size = [e.target.naturalWidth, e.target.naturalHeight]
this.baseImage = e.target
})
@@ -332,7 +332,7 @@ export class DeepZoomImage extends PIXI.Container {
useWorker = '',
minimumLevel = 0,
alpha = 1,
app = window.app
app = window.app,
} = {}
) {
super()
@@ -708,7 +708,7 @@ export class DeepZoomImage extends PIXI.Container {
let changed = { added: [], removed: [] }
let newNeeded = new Map()
let { centerCol, centerRow, needed } = this.neededTiles(tiles, level)
needed.forEach(d => {
needed.forEach((d) => {
let [url, col, row] = d
newNeeded.set(url, [col, row])
if (!tiles.requested.has(url)) {
@@ -856,7 +856,7 @@ export class DeepZoomImage extends PIXI.Container {
}
hideTilesAboveLevel(level) {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
if (tiles.level > level) {
tiles.visible = false
@@ -869,7 +869,7 @@ export class DeepZoomImage extends PIXI.Container {
* @param {number} level - The zoom level of the grid
*/
destroyTilesAboveLevel(level) {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
if (tiles.level > level && !tiles.keep) {
for (let url of tiles.available.keys()) {
@@ -882,7 +882,7 @@ export class DeepZoomImage extends PIXI.Container {
}
destroyAllTiles() {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
this.destroyTiles(key)
})
}
@@ -893,7 +893,7 @@ export class DeepZoomImage extends PIXI.Container {
* @memberof DeepZoomImage
*/
tintObsoleteTiles() {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
tiles.untintTiles()
if (!tiles.keep) {
@@ -908,7 +908,7 @@ export class DeepZoomImage extends PIXI.Container {
* @memberof DeepZoomImage
*/
destroyUnneededTiles() {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
if (!tiles.keep) {
tiles.destroyUnneededTiles()
@@ -922,7 +922,7 @@ export class DeepZoomImage extends PIXI.Container {
* @memberof DeepZoomImage
*/
destroyObsoleteTiles() {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
if (!tiles.keep) {
tiles.destroyObsoleteTiles()
@@ -937,7 +937,7 @@ export class DeepZoomImage extends PIXI.Container {
* @memberof DeepZoomImage
*/
destroyTiles() {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
if (!tiles.keep) {
tiles.destroyTiles(this.quadTrees)
@@ -949,7 +949,7 @@ export class DeepZoomImage extends PIXI.Container {
* @param {number} level - The zoom level of the grid
*/
tintTilesBelowLevel(level) {
Object.keys(this.tileLayers).forEach(key => {
Object.keys(this.tileLayers).forEach((key) => {
let tiles = this.tileLayers[key]
if (tiles.level < level) {
tiles.tintTiles(this.quadTrees)
@@ -989,7 +989,7 @@ export class DeepZoomImage extends PIXI.Container {
this.fastLoads += 1
this.populateTiles(currentTiles, this.currentLevel, {
onlyone: false,
about: event.about
about: event.about,
})
if (this.fastLoads == 3) {
this.fastLoads = 0
+3 -3
View File
@@ -40,7 +40,7 @@ export class TileLoader {
if (this.loaded.has(url)) this.loaded.delete(url)
if (this.loading.has(url)) this.loading.delete(url)
//Tile.unschedule(url)
this.loadQueue = this.loadQueue.filter(item => item != url)
this.loadQueue = this.loadQueue.filter((item) => item != url)
}
/** Cancels loading by clearing the load queue **/
@@ -246,7 +246,7 @@ export class RequestTileLoader extends TileLoader {
let xhr = new XMLHttpRequest()
xhr.open('GET', url, false)
xhr.responseType = 'arraybuffer'
xhr.onload = e => {
xhr.onload = (e) => {
let CompressedImage = PIXI.compressedTextures.CompressedImage
let compressed = CompressedImage.loadFromArrayBuffer(xhr.response, url)
let base = new PIXI.BaseTexture(compressed)
@@ -320,7 +320,7 @@ export class WorkerTileLoader extends TileLoader {
let worker = (this.worker = new Worker(workerPath))
worker.onmessage = event => {
worker.onmessage = (event) => {
if (event.data.success) {
let { url, col, row, buffer } = event.data
//console.log("WorkerTileLoader.loaded", url, buffer)
+3 -3
View File
@@ -9,12 +9,12 @@ function load() {
let [col, row, url] = tile
let xhr = new XMLHttpRequest()
xhr.responseType = 'arraybuffer'
xhr.onload = event => {
xhr.onload = (event) => {
pendingRequests.delete(url)
let buffer = xhr.response
postMessage({ success: true, url, col, row, buffer }, [buffer])
}
xhr.onerror = event => {
xhr.onerror = (event) => {
pendingRequests.delete(url)
let buffer = null
postMessage({ success: false, url, col, row, buffer })
@@ -29,7 +29,7 @@ function load() {
}
}
self.onmessage = event => {
self.onmessage = (event) => {
let msg = event.data
switch (msg.command) {
case 'load':
+3 -3
View File
@@ -51,7 +51,7 @@ export class Tiles extends PIXI.Container {
this.infoColor = Colors.random()
this.pprint()
this.destroyed = false
//this.destroyed = false
}
/** Tests whether all tiles are loaded. **/
@@ -169,7 +169,7 @@ export class Tiles extends PIXI.Container {
if (this.showGrid) {
this.highlightTile(refCol, refRow)
}
urlpos.forEach(d => {
urlpos.forEach((d) => {
let [url, col, row] = d
if (this.loader.schedule(url, col, row)) {
if (onlyone) {
@@ -229,7 +229,7 @@ export class Tiles extends PIXI.Container {
* cancelled.
**/
destroy() {
this.destroyed = true
//this.destroyed = true
this.loader.destroy()
super.destroy({ children: true }) // Calls destroyChildren
this.available.clear()
+11 -11
View File
@@ -47,7 +47,7 @@ export class ScatterLoader extends CardLoader {
width: w,
height: h,
view: canvas,
resolution: resolution
resolution: resolution,
})
let displayObject = this.scatter.displayObject
@@ -88,7 +88,7 @@ export class ScatterLoader extends CardLoader {
let image = isImage ? domNode : document.createElement('img')
let [x, y, w, h, cloneURL] = this.cloneScatterImage()
let [ww, hh] = this.unscaledSize()
image.onload = e => {
image.onload = (e) => {
if (!isImage) domNode.appendChild(image)
this.x = x
this.y = y
@@ -98,7 +98,7 @@ export class ScatterLoader extends CardLoader {
this.rotation = this.scatter.rotation
resolve(this)
}
image.onerror = e => {
image.onerror = (e) => {
reject(this)
}
image.src = cloneURL
@@ -113,7 +113,7 @@ export default class FlipEffect {
this.backLoader = backLoader
this.scatterLoader = new ScatterLoader(scatter)
this.domFlip = new DOMFlip(domScatterContainer, flipTemplate, this.scatterLoader, backLoader, {
onBack: this.backCardClosed.bind(this)
onBack: this.backCardClosed.bind(this),
})
this.setupInfoButton()
}
@@ -121,7 +121,7 @@ export default class FlipEffect {
startFlip() {
let center = this.flipCenter()
let loader = this.backLoader
this.domFlip.load().then(domFlip => {
this.domFlip.load().then((domFlip) => {
this.scatter.displayObject.visible = false
domFlip.centerAt(center)
domFlip.zoom(this.scatter.scale)
@@ -176,10 +176,10 @@ export default class FlipEffect {
this.infoBtn.lineTo(0, 14)
this.infoBtn.endFill()
this.infoBtn.on('click', e => {
this.infoBtn.on('click', (e) => {
this.infoSelected()
})
this.infoBtn.on('tap', e => {
this.infoBtn.on('tap', (e) => {
this.infoSelected()
})
@@ -200,7 +200,7 @@ export default class FlipEffect {
displayObject.addChild(this.infoBtn)
}
this.scatter.addTransformEventCallback(e => {
this.scatter.addTransformEventCallback((e) => {
let displayObject = this.scatter.displayObject
if (displayObject.foreground) {
if (e.scale) {
@@ -217,7 +217,7 @@ export default class FlipEffect {
let canvas = document.createElement('canvas')
canvas.width = 88 * 4
canvas.height = 44 * 4
svgImage.onload = e => {
svgImage.onload = (e) => {
let displayObject = this.scatter.displayObject
canvas.getContext('2d').drawImage(svgImage, 0, 0, canvas.width, canvas.height)
let texure = new PIXI.Texture(new PIXI.BaseTexture(canvas))
@@ -234,10 +234,10 @@ export default class FlipEffect {
this.infoBtn.position = new PIXI.Point(w, h)
this.infoBtn.interactive = true
this.infoBtn.updateTransform()
this.infoBtn.on('click', e => {
this.infoBtn.on('click', (e) => {
this.infoSelected()
})
this.infoBtn.on('tap', e => {
this.infoBtn.on('tap', (e) => {
this.infoSelected()
})
}
+11 -11
View File
@@ -86,7 +86,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
focus: 800,
near: 10,
far: 10000,
orthographic: false
orthographic: false,
},
opts
)
@@ -228,7 +228,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
height: this.opts.useBackTransforms ? toObject.height * 2 : fromObject.height * 2,
rotation: this.opts.useBackTransforms ? toObject.rotation : fromObject.rotation,
skewX: this.opts.useBackTransforms ? toObject.skew.x : fromObject.skew.x,
skewY: this.opts.useBackTransforms ? toObject.skew.y : fromObject.skew.y
skewY: this.opts.useBackTransforms ? toObject.skew.y : fromObject.skew.y,
}
// set toObject end values
@@ -265,7 +265,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
if (this.opts.onComplete) {
this.opts.onComplete(this, this)
}
}
},
})
// x & y
@@ -273,7 +273,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
TweenLite.to(this, this.opts.duration, {
x: to.x,
y: to.y,
ease: this.opts.transformEase
ease: this.opts.transformEase,
})
// width & height
@@ -281,7 +281,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
TweenLite.to([front, back], this.opts.duration, {
width: to.width,
height: to.height,
ease: this.opts.transformEase
ease: this.opts.transformEase,
})
// rotation
@@ -289,9 +289,9 @@ export default class Flippable extends PIXI.projection.Camera3d {
TweenLite.to(this, this.opts.duration, {
directionalRotation: {
rotation: `${to.rotation}_short`,
useRadians: true
useRadians: true,
},
ease: this.opts.transformEase
ease: this.opts.transformEase,
})
// skewX & skewY
@@ -299,7 +299,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
TweenLite.to(this.skew, this.opts.duration, {
x: to.skewX,
y: to.skewY,
ease: this.opts.transformEase
ease: this.opts.transformEase,
})
// camera
@@ -308,7 +308,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
.to(this.euler, half, {
x: this.opts.eulerX,
y: this.opts.eulerY,
ease
ease,
})
.to(this.euler, half, { x: 0, y: 0, ease })
@@ -385,7 +385,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
const bounds = displayObject.getBounds()
return {
x: bounds.x + bounds.width / 2,
y: bounds.y + bounds.height / 2
y: bounds.y + bounds.height / 2,
}
}
@@ -411,7 +411,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
displayObject.skew.x,
displayObject.skew.y,
displayObject.pivot.x,
displayObject.pivot.y
displayObject.pivot.y,
]
displayObject.position.set(0, 0)
+2 -2
View File
@@ -30,7 +30,7 @@ export class Hypenate {
result.push(p + '-')
}
result.push(last)
return result.filter(p => p.length > 0)
return result.filter((p) => p.length > 0)
}
static splitWord(word) {
@@ -288,7 +288,7 @@ export class LabeledGraphics extends PIXI.Graphics {
}
return {
text: `${data.text}${i > 0 ? ' ' : ''}${words[i]}`,
length: data.length + wordLength + spaceLength
length: data.length + wordLength + spaceLength,
}
},
{ text: '', length: dotsLength }
+14 -14
View File
@@ -54,7 +54,7 @@ export default class List extends PIXI.Container {
verticalAlign: 'middle',
width: null,
height: null,
app: null
app: null,
},
opts
)
@@ -107,7 +107,7 @@ export default class List extends PIXI.Container {
//--------------------
if (this.opts.app) {
const app = this.opts.app
app.view.addEventListener('mousewheel', event => {
app.view.addEventListener('mousewheel', (event) => {
const bounds = this.mask ? this.mask.getBounds() : this.getBounds()
const x = event.clientX - app.view.getBoundingClientRect().left
const y = event.clientY - app.view.getBoundingClientRect().top
@@ -165,13 +165,13 @@ export default class List extends PIXI.Container {
if (this.opts.orientation === 'vertical') {
switch (this.opts.align) {
case 'center':
this.__items.forEach(it => (it.x = margin + this.width / 2 - it.width / 2))
this.__items.forEach((it) => (it.x = margin + this.width / 2 - it.width / 2))
break
case 'right':
this.__items.forEach(it => (it.x = margin + this.width - it.width))
this.__items.forEach((it) => (it.x = margin + this.width - it.width))
break
default:
this.__items.forEach(it => (it.x = margin))
this.__items.forEach((it) => (it.x = margin))
break
}
@@ -191,13 +191,13 @@ export default class List extends PIXI.Container {
if (this.opts.orientation === 'horizontal') {
switch (this.opts.verticalAlign) {
case 'top':
this.__items.forEach(it => (it.y = margin))
this.__items.forEach((it) => (it.y = margin))
break
case 'bottom':
this.__items.forEach(it => (it.y = margin + this.height - it.height))
this.__items.forEach((it) => (it.y = margin + this.height - it.height))
break
default:
this.__items.forEach(it => (it.y = margin + this.height / 2 - it.height / 2))
this.__items.forEach((it) => (it.y = margin + this.height / 2 - it.height / 2))
break
}
@@ -221,7 +221,7 @@ export default class List extends PIXI.Container {
get innerWidth() {
let size = 0
this.__items.forEach(it => (size += it.width))
this.__items.forEach((it) => (size += it.width))
size += this.opts.padding * (this.__items.length - 1)
size += 2 * this.opts.margin
@@ -234,7 +234,7 @@ export default class List extends PIXI.Container {
get innerHeight() {
let size = 0
this.__items.forEach(it => (size += it.height))
this.__items.forEach((it) => (size += it.height))
size += this.opts.padding * (this.__items.length - 1)
size += 2 * this.opts.margin
@@ -268,7 +268,7 @@ export default class List extends PIXI.Container {
this.__delta = {
x: this.container.position.x - event.data.global.x,
y: this.container.position.y - event.data.global.y
y: this.container.position.y - event.data.global.y,
}
TweenLite.killTweensOf(this.container.position, { x: true, y: true })
@@ -313,7 +313,7 @@ export default class List extends PIXI.Container {
throwProps.x = {
velocity: 'auto',
min,
max: 0
max: 0,
}
} else {
let min = this.opts.height - this.innerHeight
@@ -321,7 +321,7 @@ export default class List extends PIXI.Container {
throwProps.y = {
velocity: 'auto',
min,
max: 0
max: 0,
}
}
@@ -331,7 +331,7 @@ export default class List extends PIXI.Container {
{
throwProps,
ease: Strong.easeOut,
onComplete: () => ThrowPropsPlugin.untrack(this.container.position)
onComplete: () => ThrowPropsPlugin.untrack(this.container.position),
},
0.8,
0.4
+1 -1
View File
@@ -66,7 +66,7 @@ export default class Message extends InteractivePopup {
verticalAlign: 'top', // top, middle, bottom
duration: 5,
autoClose: true,
closeDuration: theme.fast
closeDuration: theme.fast,
},
opts
)
+6 -6
View File
@@ -55,7 +55,7 @@ export default class Modal extends PIXI.Container {
backgroundFill: theme.background,
backgroundFillAlpha: 0.6,
closeOnBackground: true,
visible: true
visible: true,
},
opts
)
@@ -87,7 +87,7 @@ export default class Modal extends PIXI.Container {
// interaction
//-----------------
this.interactive = true
this.on('added', e => {
this.on('added', (e) => {
if (this.visible) {
this.show()
}
@@ -101,7 +101,7 @@ export default class Modal extends PIXI.Container {
if (this.opts.closeOnBackground) {
background.interactive = true
background.on('pointerup', e => {
background.on('pointerup', (e) => {
this.hide()
})
}
@@ -112,7 +112,7 @@ export default class Modal extends PIXI.Container {
visible: true,
onHidden: () => {
this.hide()
}
},
})
let popup = new InteractivePopup(popupOpts)
this.popup = popup
@@ -153,7 +153,7 @@ export default class Modal extends PIXI.Container {
show() {
TweenLite.to(this, this.theme.fast, {
alpha: 1,
onStart: () => (this.visible = true)
onStart: () => (this.visible = true),
})
return this
@@ -167,7 +167,7 @@ export default class Modal extends PIXI.Container {
hide() {
TweenLite.to(this, this.theme.fast, {
alpha: 0,
onComplete: () => (this.visible = false)
onComplete: () => (this.visible = false),
})
return this
+3 -3
View File
@@ -10,7 +10,7 @@ export default class Popover extends PIXI.Graphics {
placement = 'top',
width = 250,
titleStyle = {},
textStyle = { fontSize: '1.6em' }
textStyle = { fontSize: '1.6em' },
} = {}) {
super()
@@ -22,7 +22,7 @@ export default class Popover extends PIXI.Graphics {
placement,
width,
titleStyle,
textStyle
textStyle,
}
this.padding = 12
@@ -33,7 +33,7 @@ export default class Popover extends PIXI.Graphics {
stroke: '#f6f6f6',
strokeThickness: 3,
wordWrap: true,
wordWrapWidth: width - this.padding * 2
wordWrapWidth: width - this.padding * 2,
}
this.titleTextStyle = new PIXI.TextStyle(Object.assign({}, style, titleStyle))
+4 -4
View File
@@ -29,7 +29,7 @@ export class InteractivePopup extends AbstractPopup {
closeOnPopup: false,
closeButton: true,
button: null,
buttonGroup: null
buttonGroup: null,
},
opts
)
@@ -62,7 +62,7 @@ export class InteractivePopup extends AbstractPopup {
// interaction
//-----------------
this.on('pointerup', e => {
this.on('pointerup', (e) => {
if (this.opts.closeOnPopup) {
this.hide()
} else {
@@ -95,7 +95,7 @@ export class InteractivePopup extends AbstractPopup {
closeButton.interactive = true
closeButton.buttonMode = true
closeButton.on('pointerdown', e => {
closeButton.on('pointerdown', (e) => {
this.hide()
})
@@ -228,7 +228,7 @@ export default class Popup extends InteractivePopup {
{
closeButton: false,
minWidth: 0,
minHeight: 0
minHeight: 0,
},
opts
)
+6 -6
View File
@@ -50,7 +50,7 @@ export default class PopupMenu extends Popup {
items: [],
margin: theme.margin / 2,
textStyle: theme.textStyle,
closeOnPopup: true
closeOnPopup: true,
},
opts
)
@@ -88,19 +88,19 @@ export default class PopupMenu extends Popup {
object.interactive = true
object.buttonMode = true
}
object.on('pointerover', e => {
object.on('pointerover', (e) => {
TweenLite.to(object, this.theme.fast, {
alpha: 0.83,
overwrite: 'none'
overwrite: 'none',
})
})
object.on('pointerout', e => {
object.on('pointerout', (e) => {
TweenLite.to(object, this.theme.fast, {
alpha: 1,
overwrite: 'none'
overwrite: 'none',
})
})
object.on('pointerup', e => {
object.on('pointerup', (e) => {
item.action.call(object, e, object)
if (this.opts.closeOnAction) {
this.hide()
+5 -5
View File
@@ -81,7 +81,7 @@ export default class Progress extends PIXI.Container {
backgroundFillAlpha: 1,
radius: theme.radius,
destroyOnComplete: true,
visible: true
visible: true,
},
opts
)
@@ -116,7 +116,7 @@ export default class Progress extends PIXI.Container {
setup() {
// interaction
//-----------------
this.on('added', e => {
this.on('added', (e) => {
this.show()
})
@@ -261,7 +261,7 @@ export default class Progress extends PIXI.Container {
hide() {
TweenLite.to(this, this.theme.fast, {
alpha: 0,
onComplete: () => (this.visible = false)
onComplete: () => (this.visible = false),
})
return this
@@ -293,10 +293,10 @@ export default class Progress extends PIXI.Container {
if (value === 100 && this.opts.destroyOnComplete) {
TweenLite.to(this, this.theme.fast, {
alpha: 0,
onComplete: () => this.destroy({ children: true })
onComplete: () => this.destroy({ children: true }),
})
}
}
},
})
}
}
+6 -6
View File
@@ -33,7 +33,7 @@ export class ScatterContainer extends PIXI.Graphics {
showPolygon = false,
showTouches = false,
backgroundColor = null,
app = window.app
app = window.app,
} = {}
) {
super()
@@ -41,7 +41,7 @@ export class ScatterContainer extends PIXI.Graphics {
if (this.container)
this.containerDimensions = {
x: this.container.width,
y: this.container.height
y: this.container.height,
}
this.backgroundWidth = null
this.backgroundHeight = null
@@ -56,7 +56,7 @@ export class ScatterContainer extends PIXI.Graphics {
this.backgroundColor = backgroundColor
if (showBounds || showTouches || showPolygon) {
//console.log("Show TOUCHES!!!")
this.app.ticker.add(delta => this.update(delta), this)
this.app.ticker.add((delta) => this.update(delta), this)
}
if (backgroundColor) {
this.updateBackground()
@@ -277,7 +277,7 @@ export class DisplayObjectScatter extends AbstractScatter {
overdoScaling = 1.5,
onTransform = null,
onResize,
onThrowFinished = null
onThrowFinished = null,
} = {}
) {
// For the simulation of named parameters,
@@ -300,7 +300,7 @@ export class DisplayObjectScatter extends AbstractScatter {
onThrowFinished,
rotationDegrees,
rotation,
onTransform
onTransform,
})
this.onResize = onResize
this.displayObject = displayObject
@@ -325,7 +325,7 @@ export class DisplayObjectScatter extends AbstractScatter {
scale: this.scale,
x: this.x,
y: this.y,
rotation: this.rotation
rotation: this.rotation,
}
}
+5 -8
View File
@@ -43,13 +43,13 @@ export default class Scrollbox extends PIXI.Container {
underflow: 'top-left',
fadeScrollbar: false,
fadeWait: 3000,
fadeEase: 'easeInOutSine'
fadeEase: 'easeInOutSine',
},
options
)
this.ease = new PIXI.extras.Ease.list()
this.on('added', event => {
this.on('added', (event) => {
this.update()
})
@@ -63,7 +63,7 @@ export default class Scrollbox extends PIXI.Container {
passiveWheel: this.options.stopPropagation,
stopPropagation: this.options.stopPropagation,
screenWidth: this.options.boxWidth,
screenHeight: this.options.boxHeight
screenHeight: this.options.boxHeight,
})
)
this.content.decelerate().on('moved', () => this._drawScrollbars())
@@ -396,10 +396,7 @@ export default class Scrollbox extends PIXI.Container {
* @private
*/
_drawMask() {
this._maskContent
.beginFill(0)
.drawRect(0, 0, this.boxWidth, this.boxHeight)
.endFill()
this._maskContent.beginFill(0).drawRect(0, 0, this.boxWidth, this.boxHeight).endFill()
this.content.mask = this._maskContent
}
@@ -440,7 +437,7 @@ export default class Scrollbox extends PIXI.Container {
const time = this.options.fade === true ? 1000 : this.options.fade
this.fade = this.ease.to(this.scrollbar, { alpha: 0 }, time, {
wait: this.options.fadeWait,
ease: this.options.fadeEase
ease: this.options.fadeEase,
})
this.fade.on('each', () => (this.content.dirty = true))
}
+20 -20
View File
@@ -119,7 +119,7 @@ export default class Slider extends PIXI.Container {
onUpdate: null,
onComplete: null,
tooltip: null,
visible: true
visible: true,
},
opts
)
@@ -174,7 +174,7 @@ export default class Slider extends PIXI.Container {
//-----------------
const container = this.opts.container
this.on('pointermove', e => {
this.on('pointermove', (e) => {
if (this.control.dragging) {
const moveX = this.control.event.data.getLocalPosition(this.control.parent).x
this._value = this.pixelToValue(moveX - this.control.delta - this.opts.controlRadius)
@@ -188,20 +188,20 @@ export default class Slider extends PIXI.Container {
})
if (container instanceof Element) {
container.addEventListener('pointerup', e => this.onEnd(e), false)
container.addEventListener('pointercancel', e => this.onEnd(e), false)
container.addEventListener('pointerleave', e => this.onEnd(e), false)
container.addEventListener('pointerout', e => this.onEnd(e), false)
container.addEventListener('mouseup', e => this.onEnd(e), false)
container.addEventListener('mousecancel', e => this.onEnd(e), false)
container.addEventListener('mouseleave', e => this.onEnd(e), false)
container.addEventListener('mouseout', e => this.onEnd(e), false)
container.addEventListener('pointerup', (e) => this.onEnd(e), false)
container.addEventListener('pointercancel', (e) => this.onEnd(e), false)
container.addEventListener('pointerleave', (e) => this.onEnd(e), false)
container.addEventListener('pointerout', (e) => this.onEnd(e), false)
container.addEventListener('mouseup', (e) => this.onEnd(e), false)
container.addEventListener('mousecancel', (e) => this.onEnd(e), false)
container.addEventListener('mouseleave', (e) => this.onEnd(e), false)
container.addEventListener('mouseout', (e) => this.onEnd(e), false)
} else {
container.interactive = true
container.on('pointerup', e => this.onEnd(e))
container.on('pointercancel', e => this.onEnd(e))
container.on('pointerleave', e => this.onEnd(e))
container.on('pointerout', e => this.onEnd(e))
container.on('pointerup', (e) => this.onEnd(e))
container.on('pointercancel', (e) => this.onEnd(e))
container.on('pointerleave', (e) => this.onEnd(e))
container.on('pointerout', (e) => this.onEnd(e))
}
// Slider
@@ -217,7 +217,7 @@ export default class Slider extends PIXI.Container {
control.y = this.opts.controlRadius
// pointerdown on the control for dragndrop
control.on('pointerdown', e => {
control.on('pointerdown', (e) => {
control.event = e
control.delta = e.data.getLocalPosition(this.control).x
control.dragging = true
@@ -233,21 +233,21 @@ export default class Slider extends PIXI.Container {
// interaction
//-----------------
this.sliderObj.on('pointerover', e => {
this.sliderObj.on('pointerover', (e) => {
TweenLite.to(this.control, this.theme.fast, { alpha: 0.83 })
})
this.sliderObj.on('pointerout', e => {
this.sliderObj.on('pointerout', (e) => {
TweenLite.to(this.control, this.theme.fast, { alpha: 1 })
})
this.sliderObj.on('pointerdown', e => {
this.sliderObj.on('pointerdown', (e) => {
this.sliderObj.pointerdowned = true
TweenLite.to(this.control, this.theme.fast, { alpha: 0.7 })
})
// Click on the slider bar
this.sliderObj.on('pointerup', e => {
this.sliderObj.on('pointerup', (e) => {
if (this.sliderObj.pointerdowned) {
this.sliderObj.pointerdowned = false
const position = e.data.getLocalPosition(this.control.parent)
@@ -266,7 +266,7 @@ export default class Slider extends PIXI.Container {
if (typeof this.opts.tooltip === 'string') {
this.tooltip = new Tooltip({
object: this,
content: this.opts.tooltip
content: this.opts.tooltip,
})
} else {
this.opts.tooltip.object = this
+8 -8
View File
@@ -82,7 +82,7 @@ export default class Stylus extends PIXI.Graphics {
captureEvents = true,
acceptMouseEvents = true,
lineWidth = 16,
minStrokeLength = 4
minStrokeLength = 4,
} = {}) {
super()
this.activePointers = 0
@@ -164,7 +164,7 @@ export default class Stylus extends PIXI.Graphics {
}
registerEventHandler() {
window.addEventListener('keydown', e => {
window.addEventListener('keydown', (e) => {
switch (e.keyCode) {
case 38: // up arrow
this.tiltX += 5
@@ -182,7 +182,7 @@ export default class Stylus extends PIXI.Graphics {
if (this.debug) console.log('keydown', e.keyCode, this.tiltX, this.tiltY)
})
this.on('pointerdown', e => {
this.on('pointerdown', (e) => {
if (this.debug) console.log('pointerdown', e)
if (this.eventInside(e)) {
this.activePointers += 1
@@ -192,13 +192,13 @@ export default class Stylus extends PIXI.Graphics {
}
})
this.on('pointermove', e => {
this.on('pointermove', (e) => {
if (Events.isPointerDown(e.data.originalEvent) || this.isStylusPointer(e) || this.isStylusTouch(e)) {
if (this.debug) console.log('pointermove', e, this.eventInside(e))
if (this.eventInside(e) && this.singlePointer()) this.moveStroke(this.toStroke(e))
}
})
this.on('pointerup', e => {
this.on('pointerup', (e) => {
if (this.eventInside(e)) {
if (this.activePointers > 0) {
this.activePointers -= 1
@@ -207,13 +207,13 @@ export default class Stylus extends PIXI.Graphics {
}
if (this.debug) console.log('pointerup', this.activePointers)
})
this.on('pointerleave', e => {
this.on('pointerleave', (e) => {
if (this.activePointers > 0) {
this.activePointers -= 1
}
this.endStroke(this.toStroke(e))
})
this.on('pointercancel', e => {
this.on('pointercancel', (e) => {
if (this.activePointers > 0) {
this.activePointers -= 1
}
@@ -277,7 +277,7 @@ export default class Stylus extends PIXI.Graphics {
tiltX: this.tiltX,
tiltY: this.tiltY,
color: this.color,
lineWidth: this.tiltToLineWidth(this.tiltY)
lineWidth: this.tiltToLineWidth(this.tiltY),
}
return desc
}
+12 -12
View File
@@ -147,7 +147,7 @@ export default class Switch extends PIXI.Container {
beforeAction: null,
afterAction: null,
tooltip: null,
visible: true
visible: true,
},
opts
)
@@ -188,7 +188,7 @@ export default class Switch extends PIXI.Container {
controlStroke: this.opts.controlStroke,
controlStrokeWidth: this.opts.controlStrokeWidth,
controlStrokeAlpha: this.opts.controlStrokeAlpha,
controlRadius: this.opts.controlRadius
controlRadius: this.opts.controlRadius,
}
// setup
@@ -228,19 +228,19 @@ export default class Switch extends PIXI.Container {
// interaction
//-----------------
this.switchObj.on('pointerover', e => {
this.switchObj.on('pointerover', (e) => {
TweenLite.to(this.control, this.theme.fast, { alpha: 0.83 })
})
this.switchObj.on('pointerout', e => {
this.switchObj.on('pointerout', (e) => {
TweenLite.to(this.control, this.theme.fast, { alpha: 1 })
})
this.switchObj.on('pointerdown', e => {
this.switchObj.on('pointerdown', (e) => {
TweenLite.to(this.control, this.theme.fast, { alpha: 0.7 })
})
this.switchObj.on('pointerup', e => {
this.switchObj.on('pointerup', (e) => {
if (this.opts.beforeAction) {
this.opts.beforeAction.call(this, e, this)
}
@@ -278,7 +278,7 @@ export default class Switch extends PIXI.Container {
if (typeof this.opts.tooltip === 'string') {
this.tooltip = new Tooltip({
object: this,
content: this.opts.tooltip
content: this.opts.tooltip,
})
} else {
this.opts.tooltip.object = this
@@ -416,7 +416,7 @@ export default class Switch extends PIXI.Container {
stroke: this.opts.strokeActive,
controlFill: this.opts.controlFillActive,
controlStroke: this.opts.controlStrokeActive,
format: 'number'
format: 'number',
},
fillAlpha: this.opts.fillActiveAlpha,
strokeWidth: this.opts.strokeActiveWidth,
@@ -426,11 +426,11 @@ export default class Switch extends PIXI.Container {
controlStrokeAlpha: this.opts.controlStrokeActiveAlpha,
controlRadius: this.opts.controlRadiusActive,
onUpdate: () => this.drawAnimated(),
onComplete: () => this.draw()
onComplete: () => this.draw(),
})
} else {
TweenLite.to(this.control, this.opts.durationActive, {
x: this.xInactive
x: this.xInactive,
})
TweenLite.to(this.tempAnimated, this.opts.durationActive, {
colorProps: {
@@ -438,7 +438,7 @@ export default class Switch extends PIXI.Container {
stroke: this.opts.stroke,
controlFill: this.opts.controlFill,
controlStroke: this.opts.controlStroke,
format: 'number'
format: 'number',
},
fillAlpha: this.opts.fillAlpha,
strokeWidth: this.opts.strokeWidth,
@@ -448,7 +448,7 @@ export default class Switch extends PIXI.Container {
controlStrokeAlpha: this.opts.controlStrokeAlpha,
controlRadius: this.opts.controlRadius,
onUpdate: () => this.drawAnimated(),
onComplete: () => this.draw()
onComplete: () => this.draw(),
})
}
}
+1 -1
View File
@@ -121,7 +121,7 @@ export class RecorderTools extends PIXI.Container {
// Since this delegate might shadow another delegate, we mus avoid
// capturing PointerEvents.
this.delegate = new InteractionMapper(container, this, {
capturePointerEvents: false
capturePointerEvents: false,
})
}
+12 -12
View File
@@ -150,7 +150,7 @@ export default class Text extends PIXI.Container {
verticalAlign: 'middle',
tooltip: null,
badge: null,
visible: true
visible: true,
},
opts
)
@@ -171,7 +171,7 @@ export default class Text extends PIXI.Container {
strokeAlpha: 0,
strokeActiveAlpha: 0,
fillAlpha: 0,
fillActiveAlpha: 0
fillActiveAlpha: 0,
})
}
@@ -243,15 +243,15 @@ export default class Text extends PIXI.Container {
// interaction
//-----------------
this.button.on('pointerover', e => {
this.button.on('pointerover', (e) => {
this.capture(e)
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 0.83,
overwrite: 'none'
overwrite: 'none',
})
})
this.button.on('pointermove', e => {
this.button.on('pointermove', (e) => {
this.capture(e)
})
@@ -262,17 +262,17 @@ export default class Text extends PIXI.Container {
this.button.on('scroll', this.onEnd.bind(this))
// eslint-disable-next-line no-unused-vars
this.button.on('pointerdown', e => {
this.button.on('pointerdown', (e) => {
//this.capture(e)
this.__start.x = e.data.global.x
this.__start.y = e.data.global.y
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 0.7,
overwrite: 'none'
overwrite: 'none',
})
})
this.button.on('pointerup', e => {
this.button.on('pointerup', (e) => {
this.capture(e)
const distance = Points.distance(e.data.global, this.__start)
@@ -288,7 +288,7 @@ export default class Text extends PIXI.Container {
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 0.83,
overwrite: 'none'
overwrite: 'none',
})
if (this.opts.type === 'checkbox') {
@@ -315,7 +315,7 @@ export default class Text extends PIXI.Container {
if (typeof this.opts.tooltip === 'string') {
this.tooltip = new Tooltip({
object: this,
content: this.opts.tooltip
content: this.opts.tooltip,
})
} else {
this.opts.tooltip = Object.assign({}, { object: this }, this.opts.tooltip)
@@ -332,7 +332,7 @@ export default class Text extends PIXI.Container {
align: 'right',
verticalAlign: 'top',
offsetLeft: 0,
offsetTop: 0
offsetTop: 0,
}
)
if (typeof this.opts.badge === 'string') {
@@ -708,7 +708,7 @@ export default class Text extends PIXI.Container {
this.capture(event)
TweenLite.to([this.button, this.content], this.theme.fast, {
alpha: 1,
overwrite: 'none'
overwrite: 'none',
})
}
}
+2 -2
View File
@@ -112,7 +112,7 @@ export default class Theme {
textActiveAlpha: 1,
iconColor: color2,
iconColorActive: colorPrimary,
background: color1
background: color1,
},
opts
)
@@ -129,7 +129,7 @@ export default class Theme {
stroke: color1,
strokeThickness: 0,
miterLimit: 1,
lineJoin: 'round'
lineJoin: 'round',
},
this.opts.textStyle
)
+6 -6
View File
@@ -75,7 +75,7 @@ export class Ticks {
end: last,
visibleStart: visibleFirst,
visibleEnd: visibleLast,
units: units
units: units,
}
}
@@ -717,7 +717,7 @@ export default class Timeline extends BitmapLabeledGraphics {
{
x: x,
y: y,
align
align,
},
FontInfo.small
)
@@ -732,21 +732,21 @@ export default class Timeline extends BitmapLabeledGraphics {
let start = this.start.toLocaleDateString('de', {
year: 'numeric',
month: 'numeric',
day: 'numeric'
day: 'numeric',
})
let end = this.end.toLocaleDateString('de', {
year: 'numeric',
month: 'numeric',
day: 'numeric'
day: 'numeric',
})
this.ensureLabel(this.labelPrefix + 'start', start, {
x: this.toX(this.start),
y: h2
y: h2,
})
this.ensureLabel(this.labelPrefix + 'end', end, {
x: this.toX(this.end),
y: h2,
align: 'right'
align: 'right',
})
}
}
+6 -6
View File
@@ -56,7 +56,7 @@ export default class Tooltip extends AbstractPopup {
container: null,
offsetLeft: 8,
offsetTop: -8,
delay: 0
delay: 0,
},
opts
)
@@ -89,11 +89,11 @@ export default class Tooltip extends AbstractPopup {
let mouseoverTooltip = false
this.on('mouseover', e => {
this.on('mouseover', (e) => {
mouseoverTooltip = true
})
this.on('mouseout', e => {
this.on('mouseout', (e) => {
mouseoverTooltip = false
if (!mouseoverObject) {
this.hide(() => {
@@ -109,7 +109,7 @@ export default class Tooltip extends AbstractPopup {
let mouseoverObject = false
object.on('mouseover', e => {
object.on('mouseover', (e) => {
this.timeout = window.setTimeout(() => {
mouseoverObject = true
this.visible = true
@@ -118,13 +118,13 @@ export default class Tooltip extends AbstractPopup {
}, this.opts.delay * 1000)
})
object.on('mousemove', e => {
object.on('mousemove', (e) => {
if (mouseoverObject) {
this.setPosition(e)
}
})
object.on('mouseout', e => {
object.on('mouseout', (e) => {
mouseoverObject = false
window.clearTimeout(this.timeout)
if (!mouseoverTooltip) {
+2 -2
View File
@@ -59,7 +59,7 @@ export default class Volatile {
distance: 160,
duration: 1.5,
ease: Quad.easeOut,
destroyOnComplete: true
destroyOnComplete: true,
},
opts
)
@@ -149,7 +149,7 @@ export default class Volatile {
if (this.opts.destroyOnComplete) {
object.destroy({ children: true })
}
}
},
})
}