20 Commits

Author SHA1 Message Date
Uwe Oestermeier 67c6a6c95c Correct version number 2019-05-31 16:21:50 +02:00
Uwe Oestermeier 107529f844 Added warning to Tile.destroy 2019-05-31 16:10:46 +02:00
Uwe Oestermeier f39b7ae14a Adding a return value in boundary condition. 2019-05-31 15:32:13 +02:00
Manfred Knobloch aafa528f03 Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-05-31 13:59:02 +02:00
Manfred Knobloch e3f903cd48 current state 2019-05-31 13:58:24 +02:00
Manfred Knobloch 777fe83257 added bin dir 2019-05-31 13:57:43 +02:00
Uwe Oestermeier 8752d47e01 Fixed velocity computation in Throwable 2019-05-31 10:15:50 +02:00
Uwe Oestermeier cc49df6e55 Increased version number 2019-05-31 10:01:55 +02:00
Uwe Oestermeier 5b3586d8de Increased version number 2019-05-31 09:54:11 +02:00
Uwe Oestermeier d0d3a7f134 Fixed throwing problems with 2+ pointers 2019-05-31 09:51:01 +02:00
Uwe Oestermeier d114edc1e2 Removed obsolete comments. 2019-05-31 06:31:09 +02:00
Manfred Knobloch b26a5e902c testrunner first version 2019-05-29 14:24:39 +02:00
Manfred Knobloch 6678af412d Merge branch 'master' of gitea.iwm-tuebingen.de:IWMBrowser/iwmlib 2019-05-28 13:55:03 +02:00
Manfred Knobloch 34872d6b8b added testrunner current version supports screen dump of html page as png 2019-05-28 13:54:50 +02:00
Sebastian Kupke d7745f908f Updated README.md. 2019-05-27 15:46:09 +02:00
Sebastian Kupke 38a2498494 Fixed DeepZoom bounds bug. 2019-05-27 15:42:55 +02:00
Sebastian Kupke 8c513b624a Updated to Greensock-Max files. 2019-05-27 11:01:48 +02:00
Sebastian Kupke 0cfd64318f Fixed UiTest bug. 2019-05-27 10:53:51 +02:00
Sebastian Kupke ab1ad48608 Fixed missing D3 bug. 2019-05-24 14:38:03 +02:00
Sebastian Kupke d6f9c012e9 Fixed Flippable bug. 2019-05-24 14:35:37 +02:00
78 changed files with 15129 additions and 211 deletions
+26
View File
@@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}\\index.js"
},
{
"type": "node",
"request": "launch",
"name": "testrunner",
"program": "${workspaceFolder}\\bin\\testrunner.js"
},
{
"type": "node",
"request": "launch",
"name": "single",
"program": "${workspaceFolder}\\bin\\singleshot.js"
}
]
}
+1 -1
View File
@@ -47,4 +47,4 @@ Afterwards you can view the documentation here:
## List of 3<sup>rd</sup> party libraries included
- [PixiJS](http://www.pixijs.com)
- [Greensock](https://greensock.com) with TweenLite
- [Greensock](https://greensock.com) with TweenMax and TimelineMax
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

+23
View File
@@ -0,0 +1,23 @@
Testrunner prerequisites
========================
npm install puppeteer
testrunner.js
-------------
start from iwmlib directory with node testrunner
defined in package.json
"testrunner": "node bin/testrunner.js"
or in vscode, defined in launch.json like
{
"type": "node",
"request": "launch",
"name": "testrunner",
"program": "${workspaceFolder}\\bin\\testrunner.js"
}
iterates all doctest.html files that are listed in index.html
create a screenshot of all pages
+70
View File
@@ -0,0 +1,70 @@
/**
* test one single page, make a screenshot and log errors to
* console
* (c) 2019 - Leibniz-Insitut für Wissensmedien
*
*/
const puppeteer = require('puppeteer');
const fs = require("fs")
const path = require("path")
const start_dir = process.cwd()
// const start_file = path.join(start_dir,"lib","frames.html")
const start_file = path.join(start_dir,"lib","pixi","badge.html")
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
const events = ["error","pageerror"]
function logPageEvent(event){
if(event !== undefined){
console.log(event.message)
}
}
async function makeScreenshot(href){
const browser = await puppeteer.launch({
// headless: false,
// loglevel : 0,
args : [
'allow-file-access-from-files',
],});
const page = await browser.newPage();
await page.setViewport({width: 1024,height : 624})
for (var i = 0; i < events.length; i++) {
page.on(events[i],logPageEvent)
}
page.once("load",logPageEvent)
// await Promise.all([ page.coverage.startJSCoverage() ]);
await page.goto(href)
// const jsCoverage = await Promise.all([ page.coverage.stopJSCoverage() ]);
const fname = path.parse(href).name
if (fname != "index"){
image_url = href.replace(fname + ".html" ,"thumbnails/" + fname + ".png")
}
else{
image_url = href.replace(fname + ".html" ,"thumbnail.png")
}
image_url = image_url.replace("file:///","")
console.log(image_url)
// console.log(jsCoverage)
page.removeAllListeners()
await page.screenshot({path: image_url});
await browser.close();
}
(async function(){
await makeScreenshot(start_file)
}
)()
+109
View File
@@ -0,0 +1,109 @@
/**
*
* make screenshots and log errors to
* console
* (c) 2019 - Leibniz-Insitut für Wissensmedien
*
*/
const puppeteer = require('puppeteer');
const fs = require("fs")
const path = require("path")
const start_dir = process.cwd()
const start_file = path.join(start_dir,"lib","index.html")
const start_file_uri = path.join("file:///", start_file )
// define events and log them
const events = ["error","pageerror"]
function logPageEvent(event){
if (event !== undefined){
console.log(event.toString())
}
}
async function makeScreenshot(href){
const browser = await puppeteer.launch({args: [
'allow-file-access-from-files',
],});
const page = await browser.newPage();
await page.setViewport({width: 1024,height : 624})
// register events
for (var i = 0; i < events.length; i++) {
page.on(events[i],logPageEvent)
}
page.once("load",logPageEvent)
await page.goto(href)
const fname = path.parse(href).name
if (fname != "index"){
image_url = href.replace(fname + ".html" ,"thumbnails/" + fname + ".png")
}
else{
image_url = href.replace(fname + ".html" ,"thumbnail.png")
}
image_url = image_url.replace("file:///","")
page.removeAllListeners()
await page.screenshot({path: image_url});
await browser.close();
}
/**
*
* collect all navigational links in all documents
*
* */
async function collectLinks(href,reflist)
{
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.goto(href)
let hrefs = await page.$$('a.wrapper')
for (var i=0; i < hrefs.length; i++) {
let hrefValue = await hrefs[i].getProperty('href')
let linkText = await hrefValue.jsonValue();
if (!linkText.startsWith("file:"))
{
continue;
}
if(linkText.endsWith("#")) continue;
if(linkText.endsWith("index.html")){
await collectLinks(linkText,reflist)
}
reflist.push(linkText)
}
await browser.close()
}
(async function(){
var reflist = []
let linkText = "file:///" + start_file.replace(/\\/g,"/")
reflist.push(linkText)
await collectLinks(start_file_uri,reflist)
// sort by path length to get depth first
reflist.sort(function(a,b){
let al = a.split("/").length
let bl = b.split("/").length
if (al < bl) {return 1 }
if (al > bl) {return -1 }
if (al == bl) {return 0 }
})
for (var i=0;i<reflist.length; i++) {
await makeScreenshot(reflist[i])
console.log(i,reflist[i])
}
})()
+7536 -2
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
File diff suppressed because one or more lines are too long
+6162 -2
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+31 -16
View File
@@ -1687,12 +1687,23 @@
}
class InteractionDelta {
constructor(x, y, zoom, rotate, about) {
/**
*Creates an instance of InteractionDelta.
* @param {*} x
* @param {*} y
* @param {*} zoom
* @param {*} rotate
* @param {*} about
* @param {*} number - number of involved pointer
* @memberof InteractionDelta
*/
constructor(x, y, zoom, rotate, about, number) {
this.x = x;
this.y = y;
this.zoom = zoom;
this.rotate = rotate;
this.about = about;
this.number = number;
}
toString() {
@@ -1766,16 +1777,13 @@
let p1 = this.previous.get(c1.key);
let p2 = this.previous.get(c2.key);
//let p1 = previous[0]
//let p2 = previous[1]
let d1 = Points.subtract(c1, p1);
let d2 = Points.subtract(c2, p2);
let cm = Points.mean(c1, c2);
//let pm = Points.mean(p1, p2)
// UO: Using the mean lead to jumps between time slices with 3 and 2 fingers
// Using the mean leads to jumps between time slices with 3 and 2 fingers
// We use the mean of deltas instead
let delta = Points.mean(d1, d2); //Points.subtract(cm, pm)
let delta = Points.mean(d1, d2);
let zoom = 1.0;
let distance1 = Points.distance(p1, p2);
let distance2 = Points.distance(c1, c2);
@@ -1785,13 +1793,14 @@
let currentAngle = Points.angle(c1, c2);
let previousAngle = Points.angle(p1, p2);
let alpha = this.diffAngle(currentAngle, previousAngle);
return new InteractionDelta(delta.x, delta.y, zoom, alpha, cm)
return new InteractionDelta(delta.x, delta.y, zoom, alpha, cm, csize)
} else if (csize == 1 && psize == 1 && this.current.firstKey() == this.previous.firstKey()) {
// We need to ensure that the keys are the same
// We need to ensure that the keys are the same, since single points with different keys
// can jump
let current = this.current.first();
let previous = this.previous.first();
let delta = Points.subtract(current, previous);
return new InteractionDelta(delta.x, delta.y, 1.0, 0.0, current)
return new InteractionDelta(delta.x, delta.y, 1.0, 0.0, current, csize)
}
return null
}
@@ -2940,7 +2949,9 @@
this.lastframe = t;
if (dt > 0) {
// Avoid division by zero errors later on
let velocity = { t: t, dt: dt, dx: delta.x, dy: delta.y };
// and consider the number of involved pointers sind addVelocity will be called by the
// onMove events
let velocity = { t: t, dt: dt, dx: delta.x / delta.number, dy: delta.y / delta.number};
this.velocities.push(velocity);
while (this.velocities.length > buffer) {
this.velocities.shift();
@@ -2949,7 +2960,7 @@
}
meanVelocity(milliseconds = 30) {
this.addVelocity({ x: 0, y: 0 });
this.addVelocity({ x: 0, y: 0, number: 1 });
let sum = { x: 0, y: 0 };
let count = 0;
let t = 0;
@@ -3221,7 +3232,9 @@
keepOnStage(velocity, collision = 0.5) {
let stagePolygon = this.containerPolygon;
if (!stagePolygon) return
// UO: since keepOnStage is called in nextVelocity we need to
// ensure a return value
if (!stagePolygon) return { x: 0, y: 0}
let polygon = this.polygon;
let bounced = this.bouncing();
if (bounced) {
@@ -4945,11 +4958,13 @@
//console.log("iconSrc", iconSrc)
if (iconSrc.endsWith('index.png')) {
icon.src = iconSrc.replace('index.png', 'thumbnail.png');
} else if (iconSrc.endsWith('test.png')) {
icon.src = iconSrc.replace('test.png', 'thumbnail.test.png');
} else {
}
else {
icon.src = 'thumbnails/' + iconSrc;
}
// icon.src = 'thumbnails/' + iconSrc
// console.log(iconSrc)
wrapper.href = src;
let titleDiv = wrapper.querySelector('.title');
titleDiv.innerText = title;
+39 -17
View File
@@ -4851,12 +4851,23 @@
}
class InteractionDelta {
constructor(x, y, zoom, rotate, about) {
/**
*Creates an instance of InteractionDelta.
* @param {*} x
* @param {*} y
* @param {*} zoom
* @param {*} rotate
* @param {*} about
* @param {*} number - number of involved pointer
* @memberof InteractionDelta
*/
constructor(x, y, zoom, rotate, about, number) {
this.x = x;
this.y = y;
this.zoom = zoom;
this.rotate = rotate;
this.about = about;
this.number = number;
}
toString() {
@@ -4930,16 +4941,13 @@
let p1 = this.previous.get(c1.key);
let p2 = this.previous.get(c2.key);
//let p1 = previous[0]
//let p2 = previous[1]
let d1 = Points.subtract(c1, p1);
let d2 = Points.subtract(c2, p2);
let cm = Points.mean(c1, c2);
//let pm = Points.mean(p1, p2)
// UO: Using the mean lead to jumps between time slices with 3 and 2 fingers
// Using the mean leads to jumps between time slices with 3 and 2 fingers
// We use the mean of deltas instead
let delta = Points.mean(d1, d2); //Points.subtract(cm, pm)
let delta = Points.mean(d1, d2);
let zoom = 1.0;
let distance1 = Points.distance(p1, p2);
let distance2 = Points.distance(c1, c2);
@@ -4949,13 +4957,14 @@
let currentAngle = Points.angle(c1, c2);
let previousAngle = Points.angle(p1, p2);
let alpha = this.diffAngle(currentAngle, previousAngle);
return new InteractionDelta(delta.x, delta.y, zoom, alpha, cm)
return new InteractionDelta(delta.x, delta.y, zoom, alpha, cm, csize)
} else if (csize == 1 && psize == 1 && this.current.firstKey() == this.previous.firstKey()) {
// We need to ensure that the keys are the same
// We need to ensure that the keys are the same, since single points with different keys
// can jump
let current = this.current.first();
let previous = this.previous.first();
let delta = Points.subtract(current, previous);
return new InteractionDelta(delta.x, delta.y, 1.0, 0.0, current)
return new InteractionDelta(delta.x, delta.y, 1.0, 0.0, current, csize)
}
return null
}
@@ -6104,7 +6113,9 @@
this.lastframe = t;
if (dt > 0) {
// Avoid division by zero errors later on
let velocity = { t: t, dt: dt, dx: delta.x, dy: delta.y };
// and consider the number of involved pointers sind addVelocity will be called by the
// onMove events
let velocity = { t: t, dt: dt, dx: delta.x / delta.number, dy: delta.y / delta.number};
this.velocities.push(velocity);
while (this.velocities.length > buffer) {
this.velocities.shift();
@@ -6113,7 +6124,7 @@
}
meanVelocity(milliseconds = 30) {
this.addVelocity({ x: 0, y: 0 });
this.addVelocity({ x: 0, y: 0, number: 1 });
let sum = { x: 0, y: 0 };
let count = 0;
let t = 0;
@@ -6385,7 +6396,9 @@
keepOnStage(velocity, collision = 0.5) {
let stagePolygon = this.containerPolygon;
if (!stagePolygon) return
// UO: since keepOnStage is called in nextVelocity we need to
// ensure a return value
if (!stagePolygon) return { x: 0, y: 0}
let polygon = this.polygon;
let bounced = this.bouncing();
if (bounced) {
@@ -7843,7 +7856,6 @@
* @memberof Tile
*/
destroy(options, debug = false) {
if (this.parent != null) ;
let count = this.unregister();
if (count <= 0) {
let opts = { children: true, texture: true, baseTexture: true };
@@ -7855,6 +7867,11 @@
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts);
super.destroy(opts);
}
if (this.parent != null) {
// UO: Emit warning and remove
console.warn("Destroying tile with parent. Hiding instead");
this.visible = false;
}
}
}
@@ -7920,9 +7937,14 @@
console.warn("Tile already loaded");
tile.unregister();
}
try {
tile = new Tile(texture, url);
this.loaded.set(url, tile);
this.tiles.tileAvailable(tile, col, row, url);
} catch (error) {
console.warn("Tile loading error", error);
}
}
}
@@ -9113,7 +9135,7 @@
}
worldBounds() {
let viewBounds = this.app.scene.bounds;
let viewBounds = this.app.scene.getBounds();
// Using getBounds extends visible scope after loading tiles and leads
// to excessive loading
if (this.world != null) {
@@ -9924,7 +9946,7 @@
* @param {boolean} [opts.shadow=false] - Should be a shadow been display during the animation?
* @param {numer} [opts.eulerX=0] - The shift of the x-axis during the animation.
* @param {numer} [opts.eulerY=0] - The shift of the y-axis during the animation.
* @param {GSAP.Ease} [opts.eulerEase=Sine.easeOut] - The ease of the shift.
* @param {GSAP.Ease} [opts.eulerEase=Power1.easeOut] - The ease of the shift.
* @param {boolean} [opts.useBackTransforms=false] - When set to true, the flip animation also animates to the transform parameters of the back-object.
* @param {GSAP.Ease} [opts.transformEase=Power2.easeOut] - The ease of the transform.
* @param {numer} [opts.focus=800] - The value of the focus of the 3D camera (see pixi-projection).
@@ -9948,7 +9970,7 @@
shadow: false,
eulerX: 0,
eulerY: 0,
eulerEase: Sine.easeOut,
eulerEase: Power1.easeOut,
useBackTransforms: false,
transformEase: Power2.easeOut,
focus: 800,
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+3 -2
View File
@@ -15,7 +15,8 @@ function vendors() {
'./node_modules/pixi-filters/dist/pixi-filters.js',
'./node_modules/pixi-particles/dist/pixi-particles.js',
'./node_modules/pixi-projection/dist/pixi-projection.js',
'./node_modules/gsap/src/uncompressed/TweenLite.js',
'./node_modules/gsap/src/uncompressed/TweenMax.js',
'./node_modules/gsap/src/uncompressed/TimelineMax.js',
'./lib/3rdparty/pixi-ease.js',
'./lib/3rdparty/pixi-viewport.js',
'./lib/3rdparty/convertPointFromPageToNode.js'
@@ -30,7 +31,7 @@ function vendors() {
function preload() {
return src([
'./node_modules/gsap/src/uncompressed/TweenLite.js',
'./node_modules/gsap/src/uncompressed/TweenMax.js',
'./lib/3rdparty/convertPointFromPageToNode.js',
], {sourcemaps: false})
.pipe(concat('iwmlib.3rdparty.preload.js'))
+2
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -6,7 +6,7 @@
<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.3rdparty.js"></script>
<script src="../dist/iwmlib.js"></script>
</head>
<body onload="Doctest.run()">
+3 -3
View File
@@ -50,9 +50,9 @@
}
</style>
<script type="text/javascript" src=".././3rdparty/all.js"></script>
<script type="text/javascript" src="../../lib/pixi/all.js"></script>
<script type="text/javascript" src="../../lib/all.js"></script>
<script src="../../dist/iwmlib.3rdparty.js"></script>
<script src="../../dist/iwmlib.js"></script>
<script src="../../dist/iwmlib.pixi.js"></script>
</head>
<body class="site" onload="loaded()">
+5 -3
View File
@@ -30,11 +30,13 @@ export default class Index {
//console.log("iconSrc", iconSrc)
if (iconSrc.endsWith('index.png')) {
icon.src = iconSrc.replace('index.png', 'thumbnail.png')
} else if (iconSrc.endsWith('test.png')) {
icon.src = iconSrc.replace('test.png', 'thumbnail.test.png')
} else {
}
else {
icon.src = 'thumbnails/' + iconSrc
}
// icon.src = 'thumbnails/' + iconSrc
// console.log(iconSrc)
wrapper.href = src
let titleDiv = wrapper.querySelector('.title')
titleDiv.innerText = title
+19 -10
View File
@@ -122,12 +122,23 @@ export class PointMap extends MapProxy {
}
export class InteractionDelta {
constructor(x, y, zoom, rotate, about) {
/**
*Creates an instance of InteractionDelta.
* @param {*} x
* @param {*} y
* @param {*} zoom
* @param {*} rotate
* @param {*} about
* @param {*} number - number of involved pointer
* @memberof InteractionDelta
*/
constructor(x, y, zoom, rotate, about, number) {
this.x = x
this.y = y
this.zoom = zoom
this.rotate = rotate
this.about = about
this.number = number
}
toString() {
@@ -201,16 +212,13 @@ export class InteractionPoints {
let p1 = this.previous.get(c1.key)
let p2 = this.previous.get(c2.key)
//let p1 = previous[0]
//let p2 = previous[1]
let d1 = Points.subtract(c1, p1)
let d2 = Points.subtract(c2, p2)
let cm = Points.mean(c1, c2)
//let pm = Points.mean(p1, p2)
// UO: Using the mean lead to jumps between time slices with 3 and 2 fingers
// Using the mean leads to jumps between time slices with 3 and 2 fingers
// We use the mean of deltas instead
let delta = Points.mean(d1, d2) //Points.subtract(cm, pm)
let delta = Points.mean(d1, d2)
let zoom = 1.0
let distance1 = Points.distance(p1, p2)
let distance2 = Points.distance(c1, c2)
@@ -220,13 +228,14 @@ export class InteractionPoints {
let currentAngle = Points.angle(c1, c2)
let previousAngle = Points.angle(p1, p2)
let alpha = this.diffAngle(currentAngle, previousAngle)
return new InteractionDelta(delta.x, delta.y, zoom, alpha, cm)
return new InteractionDelta(delta.x, delta.y, zoom, alpha, cm, csize)
} else if (csize == 1 && psize == 1 && this.current.firstKey() == this.previous.firstKey()) {
// We need to ensure that the keys are the same
// We need to ensure that the keys are the same, since single points with different keys
// can jump
let current = this.current.first()
let previous = this.previous.first()
let delta = Points.subtract(current, previous)
return new InteractionDelta(delta.x, delta.y, 1.0, 0.0, current)
return new InteractionDelta(delta.x, delta.y, 1.0, 0.0, current, csize)
}
return null
}

Before

Width:  |  Height:  |  Size: 363 KiB

After

Width:  |  Height:  |  Size: 363 KiB

+1 -1
View File
@@ -645,7 +645,7 @@ export class DeepZoomImage extends PIXI.Container {
}
worldBounds() {
let viewBounds = this.app.scene.bounds
let viewBounds = this.app.scene.getBounds()
// Using getBounds extends visible scope after loading tiles and leads
// to excessive loading
if (this.world != null) {
+3 -2
View File
@@ -22,8 +22,9 @@
</template>
</head>
<body>
<div id="container" class="container">
</div>
<div id="container" class="container">
<a style="position: absolute; left: 22px; top: 12px;" target="_blank" href="http://www.iwm-tuebingen.de">IWM</a>
</div>
<script>
const index = new Index(itemTemplate, [
['Deepzoom', 'deepzoom.html'],
+5
View File
@@ -62,9 +62,14 @@ export class TileLoader {
console.warn("Tile already loaded")
tile.unregister()
}
try {
tile = new Tile(texture, url)
this.loaded.set(url, tile)
this.tiles.tileAvailable(tile, col, row, url)
} catch (error) {
console.warn("Tile loading error", error)
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

+5 -3
View File
@@ -59,9 +59,6 @@ export class Tile extends PIXI.Sprite {
* @memberof Tile
*/
destroy(options, debug = false) {
if (this.parent != null) {
}
let count = this.unregister()
if (count <= 0) {
let opts = { children: true, texture: true, baseTexture: true }
@@ -73,5 +70,10 @@ export class Tile extends PIXI.Sprite {
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts)
super.destroy(opts)
}
if (this.parent != null) {
// UO: Emit warning and remove
console.warn("Destroying tile with parent. Hiding instead")
this.visible = false
}
}
}
+2
View File
@@ -13,6 +13,8 @@
<script src="../../dist/iwmlib.js"></script>
<script src="../../dist/iwmlib.pixi.js"></script>
<script src="../3rdparty/gsap/src/minified/TweenMax.min.js"></script>
</head>
<body onload="Doctest.run()">
<h1>Flippable</h1>
+2 -2
View File
@@ -56,7 +56,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
* @param {boolean} [opts.shadow=false] - Should be a shadow been display during the animation?
* @param {numer} [opts.eulerX=0] - The shift of the x-axis during the animation.
* @param {numer} [opts.eulerY=0] - The shift of the y-axis during the animation.
* @param {GSAP.Ease} [opts.eulerEase=Sine.easeOut] - The ease of the shift.
* @param {GSAP.Ease} [opts.eulerEase=Power1.easeOut] - The ease of the shift.
* @param {boolean} [opts.useBackTransforms=false] - When set to true, the flip animation also animates to the transform parameters of the back-object.
* @param {GSAP.Ease} [opts.transformEase=Power2.easeOut] - The ease of the transform.
* @param {numer} [opts.focus=800] - The value of the focus of the 3D camera (see pixi-projection).
@@ -80,7 +80,7 @@ export default class Flippable extends PIXI.projection.Camera3d {
shadow: false,
eulerX: 0,
eulerY: 0,
eulerEase: Sine.easeOut,
eulerEase: Power1.easeOut,
useBackTransforms: false,
transformEase: Power2.easeOut,
focus: 800,
+4 -4
View File
@@ -12,7 +12,7 @@
<div class="preview">
<div class="thumbnail-container">
<div class="thumbnail">
<img class="icon" >
<img class="icon" src="thumbnails/notfound.png">
<!-- <iframe src="" frameborder="0"></iframe> -->
</div>
</div>
@@ -22,8 +22,9 @@
</template>
</head>
<body>
<div id="container" class="container">
</div>
<div id="container" class="container">
<a style="position: absolute; left: 22px; top: 12px;" target="_blank" href="http://www.iwm-tuebingen.de">IWM</a>
</div>
<script>
const index = new Index(itemTemplate, [
['PIXI.Application', 'application.html'],
@@ -33,7 +34,6 @@ const index = new Index(itemTemplate, [
['ButtonGroup', 'buttongroup.html'],
['Coordinates', 'coordinates.html'],
['DeepZoom', 'deepzoom/index.html'],
// ['DeepZoomImage', 'deepzoomimage.html'],
['Flippable', 'flippable.html'],
['LabeledGraphics', 'labeledgraphics.html'],
['List', 'list.html'],
-1
View File
@@ -10,7 +10,6 @@
<script src="../3rdparty/highlight/highlight.pack.js"></script>
<script src="../../dist/iwmlib.3rdparty.js"></script>
<script src="../../dist/iwmlib.js"></script>
<script src="../../dist/iwmlib.pixi.js"></script>
</head>
+2
View File
@@ -13,6 +13,8 @@
<script src="../../dist/iwmlib.js"></script>
<script src="../../dist/iwmlib.pixi.js"></script>
<script src="../3rdparty/d3.min.js"></script>
</head>
<body onload="Doctest.run()">
<h1>Text</h1>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 518 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 501 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 282 KiB

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 247 KiB

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 429 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 475 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 489 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 709 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

After

Width:  |  Height:  |  Size: 25 KiB

+7 -3
View File
@@ -127,7 +127,9 @@ class Throwable {
this.lastframe = t
if (dt > 0) {
// Avoid division by zero errors later on
let velocity = { t: t, dt: dt, dx: delta.x, dy: delta.y }
// and consider the number of involved pointers sind addVelocity will be called by the
// onMove events
let velocity = { t: t, dt: dt, dx: delta.x / delta.number, dy: delta.y / delta.number}
this.velocities.push(velocity)
while (this.velocities.length > buffer) {
this.velocities.shift()
@@ -136,7 +138,7 @@ class Throwable {
}
meanVelocity(milliseconds = 30) {
this.addVelocity({ x: 0, y: 0 })
this.addVelocity({ x: 0, y: 0, number: 1 })
let sum = { x: 0, y: 0 }
let count = 0
let t = 0
@@ -408,7 +410,9 @@ export class AbstractScatter extends Throwable {
keepOnStage(velocity, collision = 0.5) {
let stagePolygon = this.containerPolygon
if (!stagePolygon) return
// UO: since keepOnStage is called in nextVelocity we need to
// ensure a return value
if (!stagePolygon) return { x: 0, y: 0}
let polygon = this.polygon
let bounced = this.bouncing()
if (bounced) {
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

After

Width:  |  Height:  |  Size: 41 KiB

+969 -40
View File
File diff suppressed because it is too large Load Diff
+4 -3
View File
@@ -1,13 +1,13 @@
{
"name": "iwmlib",
"version": "1.0.7",
"version": "1.0.9",
"description": "An Open Source library for multi-touch, WebGL powered applications.",
"main": "index.js",
"directories": {
"example": "examples"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "node bin/testrunner.js",
"build": "rollup --config ./rollup.config.js",
"watch": "rollup --watch --config ./rollup.config.js",
"3rdparty": "gulp",
@@ -36,6 +36,7 @@
"pixi-particles": "^4.1.0",
"pixi-projection": "^0.2.7",
"pixi.js": "^4.8.7",
"propagating-hammerjs": "^1.4.6"
"propagating-hammerjs": "^1.4.6",
"puppeteer": "^1.16.0"
}
}