Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9042579518 | |||
| 11bc20fad5 | |||
| 8b9ed733dd | |||
| 5c95128dfc | |||
| beca78d7a7 | |||
| 54a1e74e27 | |||
| 909ef9d242 | |||
| 6ec0e9631a | |||
| 6f7a18d6b8 | |||
| 322fdf8deb | |||
| 012fe4bc4a | |||
| 502bdf47a3 | |||
| 437320b4ad | |||
| 3b6402a682 | |||
| fa25d13469 | |||
| 4c08359394 | |||
| b5400c8223 | |||
| 5a336e8d40 | |||
| 2d1a6b1b7f | |||
| 636e2e439c | |||
| b208592e3a | |||
| 95d1941545 | |||
| 086dfff19e | |||
| 0442df4287 | |||
| e3d167bd7f | |||
| da5ed78558 | |||
| 0c46c4e656 | |||
| 304818dc13 | |||
| 05ecd0b048 | |||
| 895ec55a46 | |||
| 67c6a6c95c | |||
| 107529f844 | |||
| f39b7ae14a | |||
| aafa528f03 | |||
| e3f903cd48 | |||
| 777fe83257 | |||
| 8752d47e01 | |||
| cc49df6e55 | |||
| 5b3586d8de | |||
| d0d3a7f134 | |||
| d114edc1e2 | |||
| b26a5e902c | |||
| 6678af412d | |||
| 34872d6b8b | |||
| d7745f908f | |||
| 38a2498494 | |||
| 8c513b624a | |||
| 0cfd64318f | |||
| ab1ad48608 | |||
| d6f9c012e9 | |||
| c8e2bea8fa | |||
| 16635078ac | |||
| d615158cf9 | |||
| f5faa6da5e | |||
| b140f0aaab | |||
| 35773f4a18 | |||
| 7f4b7fb1ff | |||
| becb749e02 | |||
| a2711a735d | |||
| 190d28b6df | |||
| c0d51af664 |
@@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -47,4 +47,4 @@ Afterwards you can view the documentation here:
|
|||||||
## List of 3<sup>rd</sup> party libraries included
|
## List of 3<sup>rd</sup> party libraries included
|
||||||
|
|
||||||
- [PixiJS](http://www.pixijs.com)
|
- [PixiJS](http://www.pixijs.com)
|
||||||
- [Greensock](https://greensock.com) with TweenLite
|
- [Greensock](https://greensock.com) with TweenMax and TimelineMax
|
||||||
|
|||||||
|
After Width: | Height: | Size: 14 KiB |
@@ -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
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
)()
|
||||||
@@ -0,0 +1,116 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* make screenshots and log errors to
|
||||||
|
* console
|
||||||
|
* (c) 2019 - Leibniz-Insitut für Wissensmedien
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
const puppeteer = require('puppeteer');
|
||||||
|
const fs_bare = require("fs") // required for fs-extra
|
||||||
|
const fs = require("fs-extra")
|
||||||
|
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)
|
||||||
|
href = href.replace("file:///","")
|
||||||
|
const fname = path.parse(href).name
|
||||||
|
let fpath
|
||||||
|
if (fname != "index"){
|
||||||
|
image_url = href.replace(fname + ".html" ,"thumbnails/" + fname + ".png")
|
||||||
|
fpath = href.replace(fname + ".html", "thumbnails")
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
image_url = href.replace(fname + ".html" ,"thumbnail.png")
|
||||||
|
fpath = href.replace(fname + ".html", "")
|
||||||
|
}
|
||||||
|
// image_url = image_url.replace("file:///","")
|
||||||
|
// fpath = fpath.replace("file:///","")
|
||||||
|
|
||||||
|
page.removeAllListeners()
|
||||||
|
|
||||||
|
fs.ensureDir(fpath)
|
||||||
|
|
||||||
|
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])
|
||||||
|
}
|
||||||
|
})()
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
|
||||||
|
.flipWrapper
|
||||||
|
{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Fix to render
|
||||||
|
.flipWrapper > div:first-child{
|
||||||
|
z-index: 1;
|
||||||
|
} */
|
||||||
|
|
||||||
|
.flipCard {
|
||||||
|
position: absolute;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
/*** See: https://stackoverflow.com/questions/7439042/css-js-to-prevent-dragging-of-ghost-image ***/
|
||||||
|
/* -webkit-user-drag: none;
|
||||||
|
-khtml-user-drag: none;
|
||||||
|
-moz-user-drag: none;
|
||||||
|
-o-user-drag: none;
|
||||||
|
user-drag: none; */
|
||||||
|
}
|
||||||
|
|
||||||
|
.flipFace{
|
||||||
|
box-shadow: 2px 2px 10px #000;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.front{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
position:absolute;
|
||||||
|
background-color:#333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.back{
|
||||||
|
background-color:#333;
|
||||||
|
position:absolute;
|
||||||
|
border: 8px solid white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.closeBtn {
|
||||||
|
transform-origin: top right;
|
||||||
|
position: absolute;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
padding: 4px;
|
||||||
|
right: 0px;
|
||||||
|
top: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.infoBtn {
|
||||||
|
transform-origin: bottom right;
|
||||||
|
position: fixed;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
padding: 4px;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.backBtn {
|
||||||
|
transform-origin: bottom right;
|
||||||
|
position: fixed;
|
||||||
|
width: 44px;
|
||||||
|
height: 44px;
|
||||||
|
padding: 4px;
|
||||||
|
right: 0px;
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
html {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
body
|
||||||
|
{
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
font-family: sans-serif;
|
||||||
|
font-size: 22pt;
|
||||||
|
-webkit-tap-highlight-color: #ccc;
|
||||||
|
background-color: #DDD;
|
||||||
|
-webkit-user-select: none;
|
||||||
|
-khtml-user-select: none;
|
||||||
|
-moz-user-select: none;
|
||||||
|
-ms-user-select: none;
|
||||||
|
-webkit-overflow-scrolling: auto;
|
||||||
|
user-select: none;
|
||||||
|
-webkit-hyphens: auto;
|
||||||
|
hyphens: auto;
|
||||||
|
/* https://davidwalsh.name/font-smoothing */
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
h3
|
||||||
|
{
|
||||||
|
color: white;
|
||||||
|
padding: 4px;
|
||||||
|
margin: 2px;
|
||||||
|
background-color: rgba(0, 0, 15, .5);
|
||||||
|
}
|
||||||
|
|
||||||
|
a { text-decoration: none; }
|
||||||
|
|
||||||
|
div.wrapper
|
||||||
|
{
|
||||||
|
overflow: hidden;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
transform-origin: 0% 100%;
|
||||||
|
transform: scale(0.25);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Color animation from https://www.tjvantoll.com/2012/02/20/css3-color-animations/ */
|
||||||
|
@-webkit-keyframes color_change {
|
||||||
|
from { background-color: rgba(0, 0, 0, 0); }
|
||||||
|
to { background-color: red; }
|
||||||
|
}
|
||||||
|
@-moz-keyframes color_change {
|
||||||
|
from { background-color: rgba(0, 0, 0, 0); }
|
||||||
|
to { background-color: red; }
|
||||||
|
}
|
||||||
|
@-ms-keyframes color_change {
|
||||||
|
from { background-color: rgba(0, 0, 0, 0); }
|
||||||
|
to { background-color: red; }
|
||||||
|
}
|
||||||
|
@-o-keyframes color_change {
|
||||||
|
from { background-color: rgba(0, 0, 0, 0); }
|
||||||
|
to { background-color: red; }
|
||||||
|
}
|
||||||
|
@keyframes color_change {
|
||||||
|
from { background-color:rgba(0, 0, 0, 0); }
|
||||||
|
to { background-color: red; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** CSS taken from https://medium.com/@jamesfuthey/simulating-the-creation-of-website-thumbnail-screenshots-using-iframes-7145269891db#.7v7fshos5 ***/
|
||||||
|
.thumbnail
|
||||||
|
{
|
||||||
|
position: relative;
|
||||||
|
-ms-zoom: 0.25;
|
||||||
|
-moz-transform: scale(0.25);
|
||||||
|
-moz-transform-origin: 0 0;
|
||||||
|
-o-transform: scale(0.25);
|
||||||
|
-o-transform-origin: 0 0;
|
||||||
|
-webkit-transform: scale(0.25);
|
||||||
|
-webkit-transform-origin: 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.thumbnail:after
|
||||||
|
{
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: -1024px; /*** This is a deviation from the above mentioned
|
||||||
|
jamesfuthey blog. Otherwise touches would go through on iPad. ***/
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumbnail iframe
|
||||||
|
{
|
||||||
|
width: 1024px;
|
||||||
|
height: 624px;
|
||||||
|
-webkit-animation-delay: 3s; /* Safari 4.0 - 8.0 */
|
||||||
|
animation-delay: 3s;
|
||||||
|
-webkit-animation: color_change 1s infinite alternate;
|
||||||
|
-moz-animation: color_change 1s infinite alternate;
|
||||||
|
-ms-animation: color_change 1s infinite alternate;
|
||||||
|
-o-animation: color_change 1s infinite alternate;
|
||||||
|
animation: color_change 1s infinite alternate;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumbnail-container
|
||||||
|
{
|
||||||
|
width: calc(1024px * 0.25);
|
||||||
|
height: calc(624px * 0.25);
|
||||||
|
display: inline-block;
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
box-shadow: 2px 2px 10px #000;
|
||||||
|
color: #DDD;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.preview
|
||||||
|
{
|
||||||
|
display: inline-block;
|
||||||
|
margin: 22px;
|
||||||
|
padding: 0px;
|
||||||
|
color: #333;
|
||||||
|
font-size: 12pt;
|
||||||
|
text-align: center;
|
||||||
|
width: 256px;
|
||||||
|
height: 196px;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.title
|
||||||
|
{
|
||||||
|
padding-top: 8px;
|
||||||
|
width: 256px;
|
||||||
|
height: 20px;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container
|
||||||
|
{
|
||||||
|
margin: 0px;
|
||||||
|
padding: 0px;
|
||||||
|
border: 2pt #000;
|
||||||
|
min-height: 100%;
|
||||||
|
min-width: 100%;
|
||||||
|
display: -webkit-flex;
|
||||||
|
-webkit-align-items: flex-end;
|
||||||
|
align-items: flex-end;
|
||||||
|
-webkit-flex-wrap: wrap;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
-webkit-align-content: flex-end;
|
||||||
|
align-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
iframe {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** See https://github.com/electron/electron/issues/4420 */
|
||||||
|
::selection {
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -1545,6 +1545,30 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ipc = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ipc = require('electron').ipcRenderer;
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
/** Basic class for app specific logging requirements.
|
||||||
|
* Can be used to implement persistent logging in electron apps.
|
||||||
|
*/
|
||||||
|
class Logging {
|
||||||
|
|
||||||
|
/** Static log function.
|
||||||
|
* @param {*} message
|
||||||
|
*/
|
||||||
|
static log(message) {
|
||||||
|
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('log', message);
|
||||||
|
} else {
|
||||||
|
console.log(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* globals Hammer, propagating */
|
/* globals Hammer, propagating */
|
||||||
|
|
||||||
/** Interaction patterns
|
/** Interaction patterns
|
||||||
@@ -1663,12 +1687,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
class InteractionDelta {
|
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.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.zoom = zoom;
|
this.zoom = zoom;
|
||||||
this.rotate = rotate;
|
this.rotate = rotate;
|
||||||
this.about = about;
|
this.about = about;
|
||||||
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
@@ -1742,16 +1777,13 @@
|
|||||||
let p1 = this.previous.get(c1.key);
|
let p1 = this.previous.get(c1.key);
|
||||||
let p2 = this.previous.get(c2.key);
|
let p2 = this.previous.get(c2.key);
|
||||||
|
|
||||||
//let p1 = previous[0]
|
|
||||||
//let p2 = previous[1]
|
|
||||||
|
|
||||||
let d1 = Points.subtract(c1, p1);
|
let d1 = Points.subtract(c1, p1);
|
||||||
let d2 = Points.subtract(c2, p2);
|
let d2 = Points.subtract(c2, p2);
|
||||||
let cm = Points.mean(c1, c2);
|
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
|
// 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 zoom = 1.0;
|
||||||
let distance1 = Points.distance(p1, p2);
|
let distance1 = Points.distance(p1, p2);
|
||||||
let distance2 = Points.distance(c1, c2);
|
let distance2 = Points.distance(c1, c2);
|
||||||
@@ -1761,13 +1793,14 @@
|
|||||||
let currentAngle = Points.angle(c1, c2);
|
let currentAngle = Points.angle(c1, c2);
|
||||||
let previousAngle = Points.angle(p1, p2);
|
let previousAngle = Points.angle(p1, p2);
|
||||||
let alpha = this.diffAngle(currentAngle, previousAngle);
|
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()) {
|
} 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 current = this.current.first();
|
||||||
let previous = this.previous.first();
|
let previous = this.previous.first();
|
||||||
let delta = Points.subtract(current, previous);
|
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
|
return null
|
||||||
}
|
}
|
||||||
@@ -1904,7 +1937,7 @@
|
|||||||
registerTap(key, point) {
|
registerTap(key, point) {
|
||||||
if (this.tapCounts.has(key)) {
|
if (this.tapCounts.has(key)) {
|
||||||
let count = this.tapCounts.get(key);
|
let count = this.tapCounts.get(key);
|
||||||
this.tapCounts.set(key, count+1);
|
this.tapCounts.set(key, count + 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.tapCounts.set(key, 1);
|
this.tapCounts.set(key, 1);
|
||||||
@@ -2095,7 +2128,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerup',
|
'pointerup',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerup');
|
if (this.debug) console.log('pointerup', e.pointerId, e.pointerType);
|
||||||
this.onEnd(e);
|
this.onEnd(e);
|
||||||
if (this.capturePointerEvents) {
|
if (this.capturePointerEvents) {
|
||||||
try {
|
try {
|
||||||
@@ -2108,7 +2141,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointercancel',
|
'pointercancel',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointercancel');
|
if (this.debug) console.log('pointercancel', e.pointerId, e.pointerType);
|
||||||
this.onEnd(e);
|
this.onEnd(e);
|
||||||
if (this.capturePointerEvents)
|
if (this.capturePointerEvents)
|
||||||
element.releasePointerCapture(e.pointerId);
|
element.releasePointerCapture(e.pointerId);
|
||||||
@@ -2120,7 +2153,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerleave',
|
'pointerleave',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerleave');
|
if (this.debug) console.log('pointerleave', e.pointerId, e.pointerType);
|
||||||
if (e.target == element) this.onEnd(e);
|
if (e.target == element) this.onEnd(e);
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
@@ -2131,7 +2164,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerout',
|
'pointerout',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerout');
|
if (this.debug) console.log('pointerout', e.pointerId, e.pointerType);
|
||||||
if (e.target == element) this.onEnd(e);
|
if (e.target == element) this.onEnd(e);
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
@@ -2142,6 +2175,7 @@
|
|||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'pointerout',
|
'pointerout',
|
||||||
e => {
|
e => {
|
||||||
|
if (this.debug) console.log('pointerout', e.pointerId, e.pointerType, e.target);
|
||||||
if (e.target == element) {
|
if (e.target == element) {
|
||||||
this.onEnd(e);
|
this.onEnd(e);
|
||||||
}
|
}
|
||||||
@@ -2450,9 +2484,10 @@
|
|||||||
constructor(
|
constructor(
|
||||||
element,
|
element,
|
||||||
target,
|
target,
|
||||||
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {}
|
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {}
|
||||||
) {
|
) {
|
||||||
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement });
|
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement });
|
||||||
|
this.logInteractionsAbove = logInteractionsAbove;
|
||||||
}
|
}
|
||||||
|
|
||||||
get targetInterface() {
|
get targetInterface() {
|
||||||
@@ -2474,6 +2509,11 @@
|
|||||||
this.interaction.addTarget(key, found);
|
this.interaction.addTarget(key, found);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let size = this.interaction.current.size;
|
||||||
|
let limit = this.logInteractionsAbove;
|
||||||
|
if (size > limit) {
|
||||||
|
Logging.log(`Number of interactions ${size} exceeds ${limit}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseWheel(event) {
|
onMouseWheel(event) {
|
||||||
@@ -2664,10 +2704,26 @@
|
|||||||
/**
|
/**
|
||||||
* Distincts if the app is running inside electron or not.
|
* Distincts if the app is running inside electron or not.
|
||||||
*
|
*
|
||||||
* source: https://discuss.atom.io/t/detect-electron-or-web-page-running/33180/3
|
* source: https://github.com/cheton/is-electron
|
||||||
*/
|
*/
|
||||||
static get isElectron() {
|
static get isElectron() {
|
||||||
return typeof process != 'undefined' && process.versions && process.versions.electron !== undefined
|
|
||||||
|
// Renderer process
|
||||||
|
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main process
|
||||||
|
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect the user agent when the `nodeIntegration` option is set to true
|
||||||
|
if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the display resolution. Necessary for retina displays.
|
/** Returns the display resolution. Necessary for retina displays.
|
||||||
@@ -2893,7 +2949,9 @@
|
|||||||
this.lastframe = t;
|
this.lastframe = t;
|
||||||
if (dt > 0) {
|
if (dt > 0) {
|
||||||
// Avoid division by zero errors later on
|
// 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);
|
this.velocities.push(velocity);
|
||||||
while (this.velocities.length > buffer) {
|
while (this.velocities.length > buffer) {
|
||||||
this.velocities.shift();
|
this.velocities.shift();
|
||||||
@@ -2902,7 +2960,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
meanVelocity(milliseconds = 30) {
|
meanVelocity(milliseconds = 30) {
|
||||||
this.addVelocity({ x: 0, y: 0 });
|
this.addVelocity({ x: 0, y: 0, number: 1 });
|
||||||
let sum = { x: 0, y: 0 };
|
let sum = { x: 0, y: 0 };
|
||||||
let count = 0;
|
let count = 0;
|
||||||
let t = 0;
|
let t = 0;
|
||||||
@@ -2937,11 +2995,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateThrow(time) {
|
_throwDeltaTime() {
|
||||||
if (this.velocity != null) {
|
|
||||||
let t = performance.now();
|
let t = performance.now();
|
||||||
let dt = t - this.lastframe;
|
let dt = t - this.lastframe;
|
||||||
this.lastframe = t;
|
this.lastframe = t;
|
||||||
|
return dt
|
||||||
|
}
|
||||||
|
|
||||||
|
animateThrow(time) {
|
||||||
|
if (this.velocity != null) {
|
||||||
|
let dt = this._throwDeltaTime();
|
||||||
// console.log("animateThrow", dt)
|
// console.log("animateThrow", dt)
|
||||||
let next = this.nextVelocity(this.velocity);
|
let next = this.nextVelocity(this.velocity);
|
||||||
let prevLength = Points.length(this.velocity);
|
let prevLength = Points.length(this.velocity);
|
||||||
@@ -3174,7 +3237,9 @@
|
|||||||
|
|
||||||
keepOnStage(velocity, collision = 0.5) {
|
keepOnStage(velocity, collision = 0.5) {
|
||||||
let stagePolygon = this.containerPolygon;
|
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 polygon = this.polygon;
|
||||||
let bounced = this.bouncing();
|
let bounced = this.bouncing();
|
||||||
if (bounced) {
|
if (bounced) {
|
||||||
@@ -4193,7 +4258,7 @@
|
|||||||
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected));
|
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected));
|
||||||
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected));
|
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected));
|
||||||
|
|
||||||
if (this.element.offsetWidth + resizeW / this.scale > this.width * 0.3 && this.element.offsetHeight + resizeH / this.scale > this.height * 0.3) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
if ((this.element.offsetWidth + resizeW) / this.scale > this.width * 0.5 / this.scale && (this.element.offsetHeight + resizeH) / this.scale > this.height * 0.3 / this.scale) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
||||||
|
|
||||||
this.oldX = e.clientX;
|
this.oldX = e.clientX;
|
||||||
this.oldY = e.clientY;
|
this.oldY = e.clientY;
|
||||||
@@ -4898,11 +4963,13 @@
|
|||||||
//console.log("iconSrc", iconSrc)
|
//console.log("iconSrc", iconSrc)
|
||||||
if (iconSrc.endsWith('index.png')) {
|
if (iconSrc.endsWith('index.png')) {
|
||||||
icon.src = iconSrc.replace('index.png', 'thumbnail.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// icon.src = 'thumbnails/' + iconSrc
|
||||||
|
// console.log(iconSrc)
|
||||||
wrapper.href = src;
|
wrapper.href = src;
|
||||||
let titleDiv = wrapper.querySelector('.title');
|
let titleDiv = wrapper.querySelector('.title');
|
||||||
titleDiv.innerText = title;
|
titleDiv.innerText = title;
|
||||||
@@ -7357,6 +7424,7 @@
|
|||||||
window.InteractionMapper = InteractionMapper$1;
|
window.InteractionMapper = InteractionMapper$1;
|
||||||
window.InteractionPoints = InteractionPoints;
|
window.InteractionPoints = InteractionPoints;
|
||||||
window.Interface = Interface;
|
window.Interface = Interface;
|
||||||
|
window.Logging = Logging;
|
||||||
window.PointMap = PointMap;
|
window.PointMap = PointMap;
|
||||||
window.Rect = Rect;
|
window.Rect = Rect;
|
||||||
window.Points = Points;
|
window.Points = Points;
|
||||||
|
|||||||
@@ -4709,6 +4709,30 @@
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ipc = null;
|
||||||
|
|
||||||
|
try {
|
||||||
|
ipc = require('electron').ipcRenderer;
|
||||||
|
} catch (e) {}
|
||||||
|
|
||||||
|
/** Basic class for app specific logging requirements.
|
||||||
|
* Can be used to implement persistent logging in electron apps.
|
||||||
|
*/
|
||||||
|
class Logging {
|
||||||
|
|
||||||
|
/** Static log function.
|
||||||
|
* @param {*} message
|
||||||
|
*/
|
||||||
|
static log(message) {
|
||||||
|
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('log', message);
|
||||||
|
} else {
|
||||||
|
console.log(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* globals Hammer, propagating */
|
/* globals Hammer, propagating */
|
||||||
|
|
||||||
/** Interaction patterns
|
/** Interaction patterns
|
||||||
@@ -4827,12 +4851,23 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
class InteractionDelta {
|
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.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
this.zoom = zoom;
|
this.zoom = zoom;
|
||||||
this.rotate = rotate;
|
this.rotate = rotate;
|
||||||
this.about = about;
|
this.about = about;
|
||||||
|
this.number = number;
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
@@ -4906,16 +4941,13 @@
|
|||||||
let p1 = this.previous.get(c1.key);
|
let p1 = this.previous.get(c1.key);
|
||||||
let p2 = this.previous.get(c2.key);
|
let p2 = this.previous.get(c2.key);
|
||||||
|
|
||||||
//let p1 = previous[0]
|
|
||||||
//let p2 = previous[1]
|
|
||||||
|
|
||||||
let d1 = Points.subtract(c1, p1);
|
let d1 = Points.subtract(c1, p1);
|
||||||
let d2 = Points.subtract(c2, p2);
|
let d2 = Points.subtract(c2, p2);
|
||||||
let cm = Points.mean(c1, c2);
|
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
|
// 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 zoom = 1.0;
|
||||||
let distance1 = Points.distance(p1, p2);
|
let distance1 = Points.distance(p1, p2);
|
||||||
let distance2 = Points.distance(c1, c2);
|
let distance2 = Points.distance(c1, c2);
|
||||||
@@ -4925,13 +4957,14 @@
|
|||||||
let currentAngle = Points.angle(c1, c2);
|
let currentAngle = Points.angle(c1, c2);
|
||||||
let previousAngle = Points.angle(p1, p2);
|
let previousAngle = Points.angle(p1, p2);
|
||||||
let alpha = this.diffAngle(currentAngle, previousAngle);
|
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()) {
|
} 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 current = this.current.first();
|
||||||
let previous = this.previous.first();
|
let previous = this.previous.first();
|
||||||
let delta = Points.subtract(current, previous);
|
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
|
return null
|
||||||
}
|
}
|
||||||
@@ -5068,7 +5101,7 @@
|
|||||||
registerTap(key, point) {
|
registerTap(key, point) {
|
||||||
if (this.tapCounts.has(key)) {
|
if (this.tapCounts.has(key)) {
|
||||||
let count = this.tapCounts.get(key);
|
let count = this.tapCounts.get(key);
|
||||||
this.tapCounts.set(key, count+1);
|
this.tapCounts.set(key, count + 1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.tapCounts.set(key, 1);
|
this.tapCounts.set(key, 1);
|
||||||
@@ -5259,7 +5292,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerup',
|
'pointerup',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerup');
|
if (this.debug) console.log('pointerup', e.pointerId, e.pointerType);
|
||||||
this.onEnd(e);
|
this.onEnd(e);
|
||||||
if (this.capturePointerEvents) {
|
if (this.capturePointerEvents) {
|
||||||
try {
|
try {
|
||||||
@@ -5272,7 +5305,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointercancel',
|
'pointercancel',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointercancel');
|
if (this.debug) console.log('pointercancel', e.pointerId, e.pointerType);
|
||||||
this.onEnd(e);
|
this.onEnd(e);
|
||||||
if (this.capturePointerEvents)
|
if (this.capturePointerEvents)
|
||||||
element.releasePointerCapture(e.pointerId);
|
element.releasePointerCapture(e.pointerId);
|
||||||
@@ -5284,7 +5317,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerleave',
|
'pointerleave',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerleave');
|
if (this.debug) console.log('pointerleave', e.pointerId, e.pointerType);
|
||||||
if (e.target == element) this.onEnd(e);
|
if (e.target == element) this.onEnd(e);
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
@@ -5295,7 +5328,7 @@
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerout',
|
'pointerout',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerout');
|
if (this.debug) console.log('pointerout', e.pointerId, e.pointerType);
|
||||||
if (e.target == element) this.onEnd(e);
|
if (e.target == element) this.onEnd(e);
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
@@ -5306,6 +5339,7 @@
|
|||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'pointerout',
|
'pointerout',
|
||||||
e => {
|
e => {
|
||||||
|
if (this.debug) console.log('pointerout', e.pointerId, e.pointerType, e.target);
|
||||||
if (e.target == element) {
|
if (e.target == element) {
|
||||||
this.onEnd(e);
|
this.onEnd(e);
|
||||||
}
|
}
|
||||||
@@ -5614,9 +5648,10 @@
|
|||||||
constructor(
|
constructor(
|
||||||
element,
|
element,
|
||||||
target,
|
target,
|
||||||
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {}
|
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {}
|
||||||
) {
|
) {
|
||||||
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement });
|
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement });
|
||||||
|
this.logInteractionsAbove = logInteractionsAbove;
|
||||||
}
|
}
|
||||||
|
|
||||||
get targetInterface() {
|
get targetInterface() {
|
||||||
@@ -5638,6 +5673,11 @@
|
|||||||
this.interaction.addTarget(key, found);
|
this.interaction.addTarget(key, found);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let size = this.interaction.current.size;
|
||||||
|
let limit = this.logInteractionsAbove;
|
||||||
|
if (size > limit) {
|
||||||
|
Logging.log(`Number of interactions ${size} exceeds ${limit}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseWheel(event) {
|
onMouseWheel(event) {
|
||||||
@@ -5828,10 +5868,26 @@
|
|||||||
/**
|
/**
|
||||||
* Distincts if the app is running inside electron or not.
|
* Distincts if the app is running inside electron or not.
|
||||||
*
|
*
|
||||||
* source: https://discuss.atom.io/t/detect-electron-or-web-page-running/33180/3
|
* source: https://github.com/cheton/is-electron
|
||||||
*/
|
*/
|
||||||
static get isElectron() {
|
static get isElectron() {
|
||||||
return typeof process != 'undefined' && process.versions && process.versions.electron !== undefined
|
|
||||||
|
// Renderer process
|
||||||
|
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main process
|
||||||
|
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect the user agent when the `nodeIntegration` option is set to true
|
||||||
|
if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the display resolution. Necessary for retina displays.
|
/** Returns the display resolution. Necessary for retina displays.
|
||||||
@@ -6057,7 +6113,9 @@
|
|||||||
this.lastframe = t;
|
this.lastframe = t;
|
||||||
if (dt > 0) {
|
if (dt > 0) {
|
||||||
// Avoid division by zero errors later on
|
// 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);
|
this.velocities.push(velocity);
|
||||||
while (this.velocities.length > buffer) {
|
while (this.velocities.length > buffer) {
|
||||||
this.velocities.shift();
|
this.velocities.shift();
|
||||||
@@ -6066,7 +6124,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
meanVelocity(milliseconds = 30) {
|
meanVelocity(milliseconds = 30) {
|
||||||
this.addVelocity({ x: 0, y: 0 });
|
this.addVelocity({ x: 0, y: 0, number: 1 });
|
||||||
let sum = { x: 0, y: 0 };
|
let sum = { x: 0, y: 0 };
|
||||||
let count = 0;
|
let count = 0;
|
||||||
let t = 0;
|
let t = 0;
|
||||||
@@ -6101,11 +6159,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateThrow(time) {
|
_throwDeltaTime() {
|
||||||
if (this.velocity != null) {
|
|
||||||
let t = performance.now();
|
let t = performance.now();
|
||||||
let dt = t - this.lastframe;
|
let dt = t - this.lastframe;
|
||||||
this.lastframe = t;
|
this.lastframe = t;
|
||||||
|
return dt
|
||||||
|
}
|
||||||
|
|
||||||
|
animateThrow(time) {
|
||||||
|
if (this.velocity != null) {
|
||||||
|
let dt = this._throwDeltaTime();
|
||||||
// console.log("animateThrow", dt)
|
// console.log("animateThrow", dt)
|
||||||
let next = this.nextVelocity(this.velocity);
|
let next = this.nextVelocity(this.velocity);
|
||||||
let prevLength = Points.length(this.velocity);
|
let prevLength = Points.length(this.velocity);
|
||||||
@@ -6338,7 +6401,9 @@
|
|||||||
|
|
||||||
keepOnStage(velocity, collision = 0.5) {
|
keepOnStage(velocity, collision = 0.5) {
|
||||||
let stagePolygon = this.containerPolygon;
|
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 polygon = this.polygon;
|
||||||
let bounced = this.bouncing();
|
let bounced = this.bouncing();
|
||||||
if (bounced) {
|
if (bounced) {
|
||||||
@@ -7195,7 +7260,7 @@
|
|||||||
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected));
|
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected));
|
||||||
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected));
|
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected));
|
||||||
|
|
||||||
if (this.element.offsetWidth + resizeW / this.scale > this.width * 0.3 && this.element.offsetHeight + resizeH / this.scale > this.height * 0.3) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
if ((this.element.offsetWidth + resizeW) / this.scale > this.width * 0.5 / this.scale && (this.element.offsetHeight + resizeH) / this.scale > this.height * 0.3 / this.scale) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
||||||
|
|
||||||
this.oldX = e.clientX;
|
this.oldX = e.clientX;
|
||||||
this.oldY = e.clientY;
|
this.oldY = e.clientY;
|
||||||
@@ -7736,8 +7801,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const deepZoomTileCache = new Map();
|
/* ES Lint */
|
||||||
|
/* globals PIXI, console*/
|
||||||
|
|
||||||
|
const registeredTiles = new Map();
|
||||||
|
// const pendingTiles = new Map()
|
||||||
|
/** Implements a baseTexture cache. The last textures are kept for reuse */
|
||||||
|
let keepTextures = 0;
|
||||||
|
const keptTextures = [];
|
||||||
|
|
||||||
/** The current Tile implementation simply uses PIXI.Sprites.
|
/** The current Tile implementation simply uses PIXI.Sprites.
|
||||||
*
|
*
|
||||||
@@ -7751,6 +7822,83 @@
|
|||||||
this.register(url);
|
this.register(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static method to enable keeping of base textures
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} value
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static enableKeepTextures(value = 1000) {
|
||||||
|
keepTextures = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Marks the given url as pending. Pending tiles should not be destroyed
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
/* static schedule(url) {
|
||||||
|
let count = 0
|
||||||
|
if (pendingTiles.has(url)) {
|
||||||
|
count = pendingTiles.get(url)
|
||||||
|
}
|
||||||
|
pendingTiles.set(url, count + 1)
|
||||||
|
// console.log("Tile.scheduled", url, pendingTiles.size)
|
||||||
|
} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes the given url from pending urls.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
/* static unschedule(url) {
|
||||||
|
if (pendingTiles.has(url)) {
|
||||||
|
let count = pendingTiles.get(url)
|
||||||
|
if (count > 1) {
|
||||||
|
pendingTiles.set(url, count - 1)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pendingTiles.clear(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// console.log("Tile.unscheduled", url, pendingTiles.size)
|
||||||
|
} */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true iff the url is pending
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
/*static isPending(url) {
|
||||||
|
return pendingTiles.has(url) && pendingTiles.get(url) > 0
|
||||||
|
} */
|
||||||
|
|
||||||
|
static isObsolete(url) {
|
||||||
|
if (registeredTiles.has(url) && registeredTiles.get(url) > 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a tile from image using the PIXI.Texture.fromImage method.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} imageId
|
||||||
|
* @param {*} crossorigin
|
||||||
|
* @param {*} scaleMode
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
static fromImage(imageId, crossorigin, scaleMode) {
|
static fromImage(imageId, crossorigin, scaleMode) {
|
||||||
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
||||||
}
|
}
|
||||||
@@ -7763,13 +7911,14 @@
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
register(url, debug = false) {
|
register(url, debug = false) {
|
||||||
if (deepZoomTileCache.has(url)) {
|
//Tile.unschedule(url)
|
||||||
let tiles = deepZoomTileCache.get(url);
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url);
|
||||||
tiles.add(this);
|
tiles.add(this);
|
||||||
if (debug) console.log("Tile.register", url, tiles.size);
|
if (debug) console.log("Tile.register", url, tiles.size);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deepZoomTileCache.set(url, new Set([this]));
|
registeredTiles.set(url, new Set([this]));
|
||||||
if (debug) console.log("Tile.register", url, 1);
|
if (debug) console.log("Tile.register", url, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -7781,10 +7930,11 @@
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
unregister() {
|
unregister() {
|
||||||
let tiles = deepZoomTileCache.get(this.url);
|
let tiles = registeredTiles.get(this.url);
|
||||||
tiles.delete(this);
|
tiles.delete(this);
|
||||||
if (tiles.size == 0) {
|
if (tiles.size == 0) {
|
||||||
deepZoomTileCache.delete(this.url);
|
registeredTiles.delete(this.url);
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return tiles.size
|
return tiles.size
|
||||||
}
|
}
|
||||||
@@ -7796,18 +7946,82 @@
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
destroy(options, debug = false) {
|
destroy(options, debug = false) {
|
||||||
if (this.parent != null) ;
|
|
||||||
let count = this.unregister();
|
let count = this.unregister();
|
||||||
if (count <= 0) {
|
|
||||||
|
if (keepTextures > 0) {
|
||||||
|
keptTextures.push({ url: this.url, texture: this.texture });
|
||||||
|
|
||||||
|
let opts = { children: true, texture: false, baseTexture: false };
|
||||||
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
||||||
|
super.destroy(opts);
|
||||||
|
|
||||||
|
while (keptTextures.length > keepTextures) {
|
||||||
|
let { url, texture } = keptTextures.shift();
|
||||||
|
if (Tile.isObsolete(url)) {
|
||||||
|
texture.destroy(true); // Destroy base as well
|
||||||
|
if (debug) console.log("Destroying texture and baseTexture", url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// No longer registered and not pending
|
||||||
|
if (count <= 0) { // && !Tile.isPending(this.url)
|
||||||
let opts = { children: true, texture: true, baseTexture: true };
|
let opts = { children: true, texture: true, baseTexture: true };
|
||||||
super.destroy(opts);
|
super.destroy(opts);
|
||||||
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts);
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let opts = { children: true, texture: false, baseTexture: false };
|
let opts = { children: true, texture: false, baseTexture: false };
|
||||||
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts);
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts);
|
||||||
super.destroy(opts);
|
super.destroy(opts);
|
||||||
}
|
}
|
||||||
|
if (this.parent != null) {
|
||||||
|
// UO: Emit warning and remove
|
||||||
|
console.warn("Destroying tile with parent. Hiding instead");
|
||||||
|
this.visible = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an available texture that can be reused
|
||||||
|
*
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static textureAvailable(url) {
|
||||||
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url);
|
||||||
|
for (let tile of tiles.values()) {
|
||||||
|
//console.log("Reusing cached texture", tile.parent)
|
||||||
|
return tile.texture
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Texture received too late. We do not need it.
|
||||||
|
* @param {*} url
|
||||||
|
* @param {*} texture
|
||||||
|
*/
|
||||||
|
static lateTexture(url, texture) {
|
||||||
|
let destroyBase = !registeredTiles.has(url);
|
||||||
|
texture.destroy(destroyBase);
|
||||||
|
}
|
||||||
|
|
||||||
|
static printInfos() {
|
||||||
|
let references = new Map();
|
||||||
|
let multiples = 0;
|
||||||
|
for (let [url, tiles] of registeredTiles.entries()) {
|
||||||
|
let count = tiles.size;
|
||||||
|
references.set(url, count);
|
||||||
|
if (count > 1) {
|
||||||
|
multiples += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log({ multiples, references });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7839,6 +8053,8 @@
|
|||||||
schedule(url, col, row) {
|
schedule(url, col, row) {
|
||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
|
//Tile.schedule(url)
|
||||||
this.map.set(url, [col, row]);
|
this.map.set(url, [col, row]);
|
||||||
this.loading.add(url);
|
this.loading.add(url);
|
||||||
this.loadQueue.push(url);
|
this.loadQueue.push(url);
|
||||||
@@ -7848,6 +8064,7 @@
|
|||||||
unschedule(url) {
|
unschedule(url) {
|
||||||
if (this.loaded.has(url)) this.loaded.delete(url);
|
if (this.loaded.has(url)) this.loaded.delete(url);
|
||||||
if (this.loading.has(url)) this.loading.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);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7873,9 +8090,14 @@
|
|||||||
console.warn("Tile already loaded");
|
console.warn("Tile already loaded");
|
||||||
tile.unregister();
|
tile.unregister();
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
tile = new Tile(texture, url);
|
tile = new Tile(texture, url);
|
||||||
this.loaded.set(url, tile);
|
this.loaded.set(url, tile);
|
||||||
this.tiles.tileAvailable(tile, col, row, url);
|
this.tiles.tileAvailable(tile, col, row, url);
|
||||||
|
} catch (error) {
|
||||||
|
console.warn("Tile loading error", error);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7902,16 +8124,13 @@
|
|||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
if (deepZoomTileCache.has(url)) {
|
//Tile.schedule(url)
|
||||||
let tiles = deepZoomTileCache.get(url);
|
let reusableTexture = Tile.textureAvailable(url);
|
||||||
for (let tile of tiles.values()) {
|
if (reusableTexture) {
|
||||||
//console.log("Reusing cached texture", tile.parent)
|
if (this.debug) console.log('Texture reusable', reusableTexture);
|
||||||
let texture = tile.texture;
|
this._textureAvailable(url, col, row, reusableTexture);
|
||||||
this._textureAvailable(url, col, row, texture);
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let texture = PIXI.utils.TextureCache[url];
|
let texture = PIXI.utils.TextureCache[url];
|
||||||
if (texture) {
|
if (texture) {
|
||||||
if (this.debug) console.log('Texture already loaded', texture);
|
if (this.debug) console.log('Texture already loaded', texture);
|
||||||
@@ -7966,8 +8185,8 @@
|
|||||||
_onLoaded(loader, resource) {
|
_onLoaded(loader, resource) {
|
||||||
if (this.destroyed) {
|
if (this.destroyed) {
|
||||||
let texture = resource.texture;
|
let texture = resource.texture;
|
||||||
let destroyBase = !deepZoomTileCache.has(resource.url);
|
let url = resource.url;
|
||||||
texture.destroy(destroyBase);
|
Tile.lateTexture(url, texture);
|
||||||
console.warn("Received resource after destroy", texture);
|
console.warn("Received resource after destroy", texture);
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -8428,19 +8647,6 @@
|
|||||||
return n % 2 == 0
|
return n % 2 == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function printTileCacheInfos() {
|
|
||||||
let references = new Map();
|
|
||||||
let multiples = 0;
|
|
||||||
for (let [url, tiles] of deepZoomTileCache.entries()) {
|
|
||||||
let count = tiles.size;
|
|
||||||
references.set(url, count);
|
|
||||||
if (count > 1) {
|
|
||||||
multiples += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log({ multiples, references });
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* A utility class that holds information typically provided by DZI files, i.e.
|
* A utility class that holds information typically provided by DZI files, i.e.
|
||||||
* height and width of the overall image, overlap, and image type.
|
* height and width of the overall image, overlap, and image type.
|
||||||
@@ -8795,6 +9001,7 @@
|
|||||||
: 1;
|
: 1;
|
||||||
this.alpha = alpha;
|
this.alpha = alpha;
|
||||||
this.fastLoads = 0;
|
this.fastLoads = 0;
|
||||||
|
this.active = true;
|
||||||
this.autoLoadTiles = autoLoadTiles;
|
this.autoLoadTiles = autoLoadTiles;
|
||||||
this.minimumLevel = minimumLevel;
|
this.minimumLevel = minimumLevel;
|
||||||
this.quadTrees = new Map(); // url as keys, TileQuadNodes as values
|
this.quadTrees = new Map(); // url as keys, TileQuadNodes as values
|
||||||
@@ -8845,7 +9052,7 @@
|
|||||||
this.minimumLevel = deepZoomInfo.baseLevel;
|
this.minimumLevel = deepZoomInfo.baseLevel;
|
||||||
}
|
}
|
||||||
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel);
|
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel);
|
||||||
console.log("autoLoadTiles", this.autoLoadTiles);
|
//console.log("autoLoadTiles", this.autoLoadTiles)
|
||||||
if (this.autoLoadTiles) {
|
if (this.autoLoadTiles) {
|
||||||
this.setupTiles(center);
|
this.setupTiles(center);
|
||||||
}
|
}
|
||||||
@@ -9066,9 +9273,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
worldBounds() {
|
worldBounds() {
|
||||||
let viewBounds = this.app.scene.bounds;
|
let viewBounds = this.app.scene.bounds || this.app.scene.getBounds();
|
||||||
// Using getBounds extends visible scope after loading tiles and leads
|
// Using getBounds extends visible scope after loading tiles and leads
|
||||||
// to excessive loading
|
// to excessive loading. So we prefer bounds over getBounds()
|
||||||
if (this.world != null) {
|
if (this.world != null) {
|
||||||
let bounds = this.world.bounds;
|
let bounds = this.world.bounds;
|
||||||
let x = Math.max(-bounds.width, bounds.x);
|
let x = Math.max(-bounds.width, bounds.x);
|
||||||
@@ -9448,6 +9655,9 @@
|
|||||||
* @param {boolean} debug - log debug infos
|
* @param {boolean} debug - log debug infos
|
||||||
*/
|
*/
|
||||||
transformed(event) {
|
transformed(event) {
|
||||||
|
if (!this.active) {
|
||||||
|
return
|
||||||
|
}
|
||||||
let key = this.currentLevel.toString();
|
let key = this.currentLevel.toString();
|
||||||
let currentTiles = this.tileLayers[key];
|
let currentTiles = this.tileLayers[key];
|
||||||
if (typeof currentTiles == 'undefined') {
|
if (typeof currentTiles == 'undefined') {
|
||||||
@@ -9495,6 +9705,7 @@
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
activate() {
|
activate() {
|
||||||
|
this.active = true;
|
||||||
this.destroyTilesAboveLevel(this.currentLevel);
|
this.destroyTilesAboveLevel(this.currentLevel);
|
||||||
this.ensureTiles(this.currentLevel, null);
|
this.ensureTiles(this.currentLevel, null);
|
||||||
//console.log("Activate Textures!", this.currentLevel)
|
//console.log("Activate Textures!", this.currentLevel)
|
||||||
@@ -9506,35 +9717,19 @@
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
deactivate() {
|
deactivate() {
|
||||||
|
this.active = false;
|
||||||
this.destroyAllTiles();
|
this.destroyAllTiles();
|
||||||
Object.keys(this.tileLayers).forEach(key => {
|
|
||||||
this.destroyTiles(key);
|
|
||||||
});
|
|
||||||
this.tileContainer.destroy({ children: true });
|
this.tileContainer.destroy({ children: true });
|
||||||
printTileCacheInfos();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throwFinished() {
|
throwFinished() {
|
||||||
console.log("throwFinished");
|
//console.log("throwFinished")
|
||||||
let key = this.currentLevel.toString();
|
let key = this.currentLevel.toString();
|
||||||
let currentTiles = this.tileLayers[key];
|
let currentTiles = this.tileLayers[key];
|
||||||
if (typeof currentTiles == 'undefined') {
|
if (typeof currentTiles == 'undefined') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ensureTiles(this.currentLevel);
|
this.ensureTiles(this.currentLevel);
|
||||||
// let all = new Set()
|
|
||||||
// for (let tile of currentTiles.children) {
|
|
||||||
// all.add(tile.url)
|
|
||||||
// }
|
|
||||||
// let { centerCol, centerRow, needed } = this.neededTiles(currentTiles, this.currentLevel)
|
|
||||||
// for (let [url, col, row] of needed) {
|
|
||||||
// all.delete(url)
|
|
||||||
// }
|
|
||||||
// for (let url of all) {
|
|
||||||
// currentTiles.destroyTileByUrl(url)
|
|
||||||
// }
|
|
||||||
// currentTiles.loader.loader.reset()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9877,7 +10072,7 @@
|
|||||||
* @param {boolean} [opts.shadow=false] - Should be a shadow been display during the animation?
|
* @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.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 {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 {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 {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).
|
* @param {numer} [opts.focus=800] - The value of the focus of the 3D camera (see pixi-projection).
|
||||||
@@ -9901,7 +10096,7 @@
|
|||||||
shadow: false,
|
shadow: false,
|
||||||
eulerX: 0,
|
eulerX: 0,
|
||||||
eulerY: 0,
|
eulerY: 0,
|
||||||
eulerEase: Sine.easeOut,
|
eulerEase: Power1.easeOut,
|
||||||
useBackTransforms: false,
|
useBackTransforms: false,
|
||||||
transformEase: Power2.easeOut,
|
transformEase: Power2.easeOut,
|
||||||
focus: 800,
|
focus: 800,
|
||||||
|
|||||||
@@ -1864,7 +1864,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
this.minimumLevel = deepZoomInfo.baseLevel
|
this.minimumLevel = deepZoomInfo.baseLevel
|
||||||
}
|
}
|
||||||
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
||||||
console.log("autoLoadTiles", this.autoLoadTiles)
|
//console.log("autoLoadTiles", this.autoLoadTiles)
|
||||||
if (this.autoLoadTiles) {
|
if (this.autoLoadTiles) {
|
||||||
this.setupTiles(center)
|
this.setupTiles(center)
|
||||||
}
|
}
|
||||||
|
|||||||
|
After Width: | Height: | Size: 19 KiB |
@@ -15,7 +15,8 @@ function vendors() {
|
|||||||
'./node_modules/pixi-filters/dist/pixi-filters.js',
|
'./node_modules/pixi-filters/dist/pixi-filters.js',
|
||||||
'./node_modules/pixi-particles/dist/pixi-particles.js',
|
'./node_modules/pixi-particles/dist/pixi-particles.js',
|
||||||
'./node_modules/pixi-projection/dist/pixi-projection.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-ease.js',
|
||||||
'./lib/3rdparty/pixi-viewport.js',
|
'./lib/3rdparty/pixi-viewport.js',
|
||||||
'./lib/3rdparty/convertPointFromPageToNode.js'
|
'./lib/3rdparty/convertPointFromPageToNode.js'
|
||||||
@@ -30,7 +31,7 @@ function vendors() {
|
|||||||
|
|
||||||
function preload() {
|
function preload() {
|
||||||
return src([
|
return src([
|
||||||
'./node_modules/gsap/src/uncompressed/TweenLite.js',
|
'./node_modules/gsap/src/uncompressed/TweenMax.js',
|
||||||
'./lib/3rdparty/convertPointFromPageToNode.js',
|
'./lib/3rdparty/convertPointFromPageToNode.js',
|
||||||
], {sourcemaps: false})
|
], {sourcemaps: false})
|
||||||
.pipe(concat('iwmlib.3rdparty.preload.js'))
|
.pipe(concat('iwmlib.3rdparty.preload.js'))
|
||||||
|
|||||||
@@ -1,55 +1,54 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
<!-- <script type="text/javascript" src="interface.js"></script> -->
|
<!-- <script type="text/javascript" src="interface.js"></script> -->
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
|
||||||
<h1>
|
<body onload="Doctest.run()">
|
||||||
|
<h1>
|
||||||
Application
|
Application
|
||||||
</h1>
|
</h1>
|
||||||
<p>
|
<p>
|
||||||
IWM Browser Applications follow a common three phase pattern, shared by
|
IWM Browser Applications follow a common three phase pattern, shared by many programming environments as diverse as Processing, Arduino, Intern, etc.
|
||||||
many programming environments as diverse as Processing, Arduino, Intern, etc.
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Instantiate: Initialize the application, in this case a singleton and it's instance variables</li>
|
<li>Instantiate: Initialize the application, in this case a singleton and it's instance variables</li>
|
||||||
<li>Setup: Build more complex parts of the application, by loading data, creating the UI...</li>
|
<li>Setup: Build more complex parts of the application, by loading data, creating the UI...</li>
|
||||||
<li>Run: Enter and run the main loop of the application.</li>
|
<li>Run: Enter and run the main loop of the application.</li>
|
||||||
</ul>
|
</ul>
|
||||||
This pattern is reflected by the IApp Interface:
|
This pattern is reflected by the IApp Interface:
|
||||||
</p>
|
</p>
|
||||||
<pre><code class="js">
|
<pre><code class="js">
|
||||||
class IApp extends Interface {
|
class IApp extends Interface {
|
||||||
setup() { return this }
|
setup() { return this }
|
||||||
run() { return this }
|
run() { return this }
|
||||||
}
|
}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
<p>In practice the pattern may be more complex, because the setup phase can only be entered
|
<p>In practice the pattern may be more complex, because the setup phase can only be entered after loading things, a main loop cannot be entered because requirements are not met, etc. But the basic structure is always the same:
|
||||||
after loading things, a main loop cannot be entered because requirements are not met, etc.
|
</p>
|
||||||
But the basic structure is always the same:
|
<script type="module" class="doctest">
|
||||||
</p>
|
|
||||||
<script type="module" class="doctest">
|
|
||||||
console.log("Innerhalb script type=module")
|
console.log("Innerhalb script type=module")
|
||||||
import App from "./app.js"
|
import App from "./app.js"
|
||||||
const app = new App()
|
const app = new App()
|
||||||
app.setup()
|
app.setup()
|
||||||
app.run()
|
app.run()
|
||||||
window.app = app
|
window.app = app
|
||||||
</script>
|
</script>
|
||||||
<p>The setup and run methods can also be chained:
|
<p>The setup and run methods can also be chained:
|
||||||
</p>
|
</p>
|
||||||
<script type="module" class="doctest">
|
<script type="module" class="doctest">
|
||||||
app.setup().run()
|
app.setup().run()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<h2>
|
<h2>
|
||||||
References
|
References
|
||||||
</h2>
|
</h2>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://theintern.github.io/intern/#common-config">Intern. Software testing for humans</a></li>
|
<li><a href="https://theintern.github.io/intern/#common-config">Intern. Software testing for humans</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</body>
|
</body>
|
||||||
@@ -5,6 +5,7 @@ import Events from './events.js'
|
|||||||
import {DOMFlip, DOMFlippable, CardLoader, PDFLoader, ImageLoader, FrameLoader, HTMLLoader} from './flippable.js'
|
import {DOMFlip, DOMFlippable, CardLoader, PDFLoader, ImageLoader, FrameLoader, HTMLLoader} from './flippable.js'
|
||||||
import Index from './index.js'
|
import Index from './index.js'
|
||||||
import Interface from './interface.js'
|
import Interface from './interface.js'
|
||||||
|
import Logging from './logging.js'
|
||||||
import Poppable from './poppable.js'
|
import Poppable from './poppable.js'
|
||||||
import PopupMenu from './popupmenu.js'
|
import PopupMenu from './popupmenu.js'
|
||||||
import Popup from './popup.js'
|
import Popup from './popup.js'
|
||||||
@@ -60,6 +61,7 @@ window.InteractionDelta = InteractionDelta
|
|||||||
window.InteractionMapper = InteractionMapper
|
window.InteractionMapper = InteractionMapper
|
||||||
window.InteractionPoints = InteractionPoints
|
window.InteractionPoints = InteractionPoints
|
||||||
window.Interface = Interface
|
window.Interface = Interface
|
||||||
|
window.Logging = Logging
|
||||||
window.PointMap = PointMap
|
window.PointMap = PointMap
|
||||||
window.Rect = Rect
|
window.Rect = Rect
|
||||||
window.Points = Points
|
window.Points = Points
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Doctests Capabilities</title>
|
<title>Doctests Capabilities</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script type="text/javascript" src="all.js"></script>
|
<script type="text/javascript" src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run(); CapabilitiesTests.testAll()">
|
<body onload="Doctest.run(); CapabilitiesTests.testAll()">
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
@@ -37,10 +37,26 @@ export class Capabilities {
|
|||||||
/**
|
/**
|
||||||
* Distincts if the app is running inside electron or not.
|
* Distincts if the app is running inside electron or not.
|
||||||
*
|
*
|
||||||
* source: https://discuss.atom.io/t/detect-electron-or-web-page-running/33180/3
|
* source: https://github.com/cheton/is-electron
|
||||||
*/
|
*/
|
||||||
static get isElectron() {
|
static get isElectron() {
|
||||||
return typeof process != 'undefined' && process.versions && process.versions.electron !== undefined
|
|
||||||
|
// Renderer process
|
||||||
|
if (typeof window !== 'undefined' && typeof window.process === 'object' && window.process.type === 'renderer') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main process
|
||||||
|
if (typeof process !== 'undefined' && typeof process.versions === 'object' && !!process.versions.electron) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
// Detect the user agent when the `nodeIntegration` option is set to true
|
||||||
|
if (typeof navigator === 'object' && typeof navigator.userAgent === 'string' && navigator.userAgent.indexOf('Electron') >= 0) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the display resolution. Necessary for retina displays.
|
/** Returns the display resolution. Necessary for retina displays.
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Coordinates Doctest</title>
|
<title>Coordinates Doctest</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="./3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function drawPolygons() {
|
function drawPolygons() {
|
||||||
canvas.width = main.getBoundingClientRect().width
|
canvas.width = main.getBoundingClientRect().width
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Doctests</title>
|
<title>Doctests</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Electron Node.js Test</title>
|
<title>Electron Node.js Test</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="./3rdparty/all.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../../lib/3rdparty/all.js"></script>
|
<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/pixi/all.js"></script>
|
||||||
<script type="text/javascript" src="../../../lib/all.js"></script>
|
<script type="text/javascript" src="../../../lib/all.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@@ -50,9 +50,9 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script type="text/javascript" src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script type="text/javascript" src="../../lib/pixi/all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script type="text/javascript" src="../../lib/all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="site" onload="loaded()">
|
<body class="site" onload="loaded()">
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Flippable Doctest</title>
|
<title>Flippable Doctest</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../css/flipeffect.css">
|
<link rel="stylesheet" href="../css/flipeffect.css">
|
||||||
<template id="flipTemplate">
|
<template id="flipTemplate">
|
||||||
|
|||||||
@@ -3,11 +3,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
|
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="./3rdparty/all.js"></script>
|
||||||
|
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
<html>
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<title>Lib Doctests</title>
|
<title>Lib Doctests</title>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
|
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||||
<link rel="stylesheet" href="../css/index.css">
|
<link rel="stylesheet" href="../css/index.css">
|
||||||
<script src="all.js"></script>
|
|
||||||
|
<!-- following not necc for index.js included in iwmlib.js -->
|
||||||
|
<!-- <script src="./index.js"></script> -->
|
||||||
|
|
||||||
|
<script src="../dist/iwmlib.js"></script>
|
||||||
|
|
||||||
<template id="itemTemplate">
|
<template id="itemTemplate">
|
||||||
<a class="wrapper" href="">
|
<a class="wrapper" href="">
|
||||||
|
|||||||
@@ -30,11 +30,13 @@ export default class Index {
|
|||||||
//console.log("iconSrc", iconSrc)
|
//console.log("iconSrc", iconSrc)
|
||||||
if (iconSrc.endsWith('index.png')) {
|
if (iconSrc.endsWith('index.png')) {
|
||||||
icon.src = iconSrc.replace('index.png', 'thumbnail.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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// icon.src = 'thumbnails/' + iconSrc
|
||||||
|
// console.log(iconSrc)
|
||||||
wrapper.href = src
|
wrapper.href = src
|
||||||
let titleDiv = wrapper.querySelector('.title')
|
let titleDiv = wrapper.querySelector('.title')
|
||||||
titleDiv.innerText = title
|
titleDiv.innerText = title
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run(); test()" >
|
<body onload="Doctest.run(); test()" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Interaction Mapper Doctest</title>
|
<title>Interaction Mapper Doctest</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
<script src="./3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>
|
<h1>
|
||||||
@@ -23,7 +23,7 @@ a single delegate pattern.
|
|||||||
<p>The main differences are that <code>PointerEvent</code> are fired for each
|
<p>The main differences are that <code>PointerEvent</code> are fired for each
|
||||||
touch point, whereas the <code>TouchEvent</code> collects multiple
|
touch point, whereas the <code>TouchEvent</code> collects multiple
|
||||||
<code>TouchPoints</code> into a single event. The basic PointMap and Interaction
|
<code>TouchPoints</code> into a single event. The basic PointMap and Interaction
|
||||||
classes unify this behavior by collection all contact points regardless
|
classes unify this behavior by collecting all contact points regardless
|
||||||
of their original mouse, touch, or pointer events.</p>
|
of their original mouse, touch, or pointer events.</p>
|
||||||
<h2>
|
<h2>
|
||||||
Point Maps
|
Point Maps
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import Interface from './interface.js'
|
import Interface from './interface.js'
|
||||||
import { Points, Angle, MapProxy } from './utils.js'
|
import { Points, Angle, MapProxy } from './utils.js'
|
||||||
import Events from './events.js'
|
import Events from './events.js'
|
||||||
|
import Logging from './logging.js'
|
||||||
|
|
||||||
/** Interaction patterns
|
/** Interaction patterns
|
||||||
|
|
||||||
@@ -121,12 +122,23 @@ export class PointMap extends MapProxy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class InteractionDelta {
|
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.x = x
|
||||||
this.y = y
|
this.y = y
|
||||||
this.zoom = zoom
|
this.zoom = zoom
|
||||||
this.rotate = rotate
|
this.rotate = rotate
|
||||||
this.about = about
|
this.about = about
|
||||||
|
this.number = number
|
||||||
}
|
}
|
||||||
|
|
||||||
toString() {
|
toString() {
|
||||||
@@ -200,16 +212,13 @@ export class InteractionPoints {
|
|||||||
let p1 = this.previous.get(c1.key)
|
let p1 = this.previous.get(c1.key)
|
||||||
let p2 = this.previous.get(c2.key)
|
let p2 = this.previous.get(c2.key)
|
||||||
|
|
||||||
//let p1 = previous[0]
|
|
||||||
//let p2 = previous[1]
|
|
||||||
|
|
||||||
let d1 = Points.subtract(c1, p1)
|
let d1 = Points.subtract(c1, p1)
|
||||||
let d2 = Points.subtract(c2, p2)
|
let d2 = Points.subtract(c2, p2)
|
||||||
let cm = Points.mean(c1, c2)
|
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
|
// 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 zoom = 1.0
|
||||||
let distance1 = Points.distance(p1, p2)
|
let distance1 = Points.distance(p1, p2)
|
||||||
let distance2 = Points.distance(c1, c2)
|
let distance2 = Points.distance(c1, c2)
|
||||||
@@ -219,13 +228,14 @@ export class InteractionPoints {
|
|||||||
let currentAngle = Points.angle(c1, c2)
|
let currentAngle = Points.angle(c1, c2)
|
||||||
let previousAngle = Points.angle(p1, p2)
|
let previousAngle = Points.angle(p1, p2)
|
||||||
let alpha = this.diffAngle(currentAngle, previousAngle)
|
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()) {
|
} 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 current = this.current.first()
|
||||||
let previous = this.previous.first()
|
let previous = this.previous.first()
|
||||||
let delta = Points.subtract(current, previous)
|
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
|
return null
|
||||||
}
|
}
|
||||||
@@ -362,7 +372,7 @@ export class Interaction extends InteractionPoints {
|
|||||||
registerTap(key, point) {
|
registerTap(key, point) {
|
||||||
if (this.tapCounts.has(key)) {
|
if (this.tapCounts.has(key)) {
|
||||||
let count = this.tapCounts.get(key)
|
let count = this.tapCounts.get(key)
|
||||||
this.tapCounts.set(key, count+1)
|
this.tapCounts.set(key, count + 1)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.tapCounts.set(key, 1)
|
this.tapCounts.set(key, 1)
|
||||||
@@ -553,7 +563,7 @@ export class InteractionDelegate {
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerup',
|
'pointerup',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerup')
|
if (this.debug) console.log('pointerup', e.pointerId, e.pointerType)
|
||||||
this.onEnd(e)
|
this.onEnd(e)
|
||||||
if (this.capturePointerEvents) {
|
if (this.capturePointerEvents) {
|
||||||
try {
|
try {
|
||||||
@@ -566,7 +576,7 @@ export class InteractionDelegate {
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointercancel',
|
'pointercancel',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointercancel')
|
if (this.debug) console.log('pointercancel', e.pointerId, e.pointerType)
|
||||||
this.onEnd(e)
|
this.onEnd(e)
|
||||||
if (this.capturePointerEvents)
|
if (this.capturePointerEvents)
|
||||||
element.releasePointerCapture(e.pointerId)
|
element.releasePointerCapture(e.pointerId)
|
||||||
@@ -578,7 +588,7 @@ export class InteractionDelegate {
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerleave',
|
'pointerleave',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerleave')
|
if (this.debug) console.log('pointerleave', e.pointerId, e.pointerType)
|
||||||
if (e.target == element) this.onEnd(e)
|
if (e.target == element) this.onEnd(e)
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
@@ -589,7 +599,7 @@ export class InteractionDelegate {
|
|||||||
element.addEventListener(
|
element.addEventListener(
|
||||||
'pointerout',
|
'pointerout',
|
||||||
e => {
|
e => {
|
||||||
if (this.debug) console.log('pointerout')
|
if (this.debug) console.log('pointerout', e.pointerId, e.pointerType)
|
||||||
if (e.target == element) this.onEnd(e)
|
if (e.target == element) this.onEnd(e)
|
||||||
},
|
},
|
||||||
useCapture
|
useCapture
|
||||||
@@ -600,6 +610,7 @@ export class InteractionDelegate {
|
|||||||
window.addEventListener(
|
window.addEventListener(
|
||||||
'pointerout',
|
'pointerout',
|
||||||
e => {
|
e => {
|
||||||
|
if (this.debug) console.log('pointerout', e.pointerId, e.pointerType, e.target)
|
||||||
if (e.target == element) {
|
if (e.target == element) {
|
||||||
this.onEnd(e)
|
this.onEnd(e)
|
||||||
}
|
}
|
||||||
@@ -910,9 +921,10 @@ export class InteractionMapper extends InteractionDelegate {
|
|||||||
constructor(
|
constructor(
|
||||||
element,
|
element,
|
||||||
target,
|
target,
|
||||||
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null } = {}
|
{ tapDistance = 10, longPressTime = 500.0, useCapture = true, mouseWheelElement = null, logInteractionsAbove = 12 } = {}
|
||||||
) {
|
) {
|
||||||
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement })
|
super(element, target, { tapDistance, useCapture, longPressTime, mouseWheelElement })
|
||||||
|
this.logInteractionsAbove = logInteractionsAbove
|
||||||
}
|
}
|
||||||
|
|
||||||
get targetInterface() {
|
get targetInterface() {
|
||||||
@@ -934,6 +946,11 @@ export class InteractionMapper extends InteractionDelegate {
|
|||||||
this.interaction.addTarget(key, found)
|
this.interaction.addTarget(key, found)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let size = this.interaction.current.size
|
||||||
|
let limit = this.logInteractionsAbove
|
||||||
|
if (size > limit) {
|
||||||
|
Logging.log(`Number of interactions ${size} exceeds ${limit}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMouseWheel(event) {
|
onMouseWheel(event) {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title>Logging Doctest</title>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-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="../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
<script src="../dist/iwmlib.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body id="page" onload="Doctest.run()">
|
||||||
|
<h1>
|
||||||
|
Logging
|
||||||
|
</h1>
|
||||||
|
<p>Store informations of your app permanently.</p>
|
||||||
|
<script class="doctest">
|
||||||
|
Logging.log('app started')
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
let ipc = null
|
||||||
|
let logMessages = new Set()
|
||||||
|
|
||||||
|
try {
|
||||||
|
ipc = require('electron').ipcRenderer
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Cannot use electron logging.")
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Basic class for app specific logging requirements.
|
||||||
|
* Can be used to implement persistent logging in electron apps.
|
||||||
|
* Uses a logMessage cache to prevent error overflows. This is
|
||||||
|
* needed since errors may occur very frequently
|
||||||
|
* (e.g. display update loops at 60fps, programmatic loops, ...).
|
||||||
|
*/
|
||||||
|
export default class Logging {
|
||||||
|
|
||||||
|
/** Static log function.
|
||||||
|
* @param {*} message
|
||||||
|
*/
|
||||||
|
static log(message) {
|
||||||
|
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('log', message)
|
||||||
|
} else {
|
||||||
|
console.log(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static warn function.
|
||||||
|
* Emits each warning only once per session.
|
||||||
|
* @param {*} message
|
||||||
|
*/
|
||||||
|
static warn(message) {
|
||||||
|
if (!logMessages.has(message)) {
|
||||||
|
logMessages.add(message)
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('warn', message)
|
||||||
|
} else {
|
||||||
|
console.warn(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static error function.
|
||||||
|
* Emits each error message only once per session.
|
||||||
|
* @param {*} message
|
||||||
|
*/
|
||||||
|
static error(message) {
|
||||||
|
if (!logMessages.has(message)) {
|
||||||
|
logMessages.add(message)
|
||||||
|
if (ipc) {
|
||||||
|
ipc.send('error', message)
|
||||||
|
} else {
|
||||||
|
console.error(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
<title>PIXI Application Resolution Doctest</title>
|
<title>PIXI Application Resolution Doctest</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src=".././3rdparty/all.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src=".../../dist/iwmlib.pixi.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#dpi {
|
#dpi {
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
<title>PIXI Application Doctest</title>
|
<title>PIXI Application Doctest</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Application</h1>
|
<h1>Application</h1>
|
||||||
|
|||||||
@@ -5,7 +5,10 @@
|
|||||||
|
|
||||||
<title>PIXI.Application Doctest</title>
|
<title>PIXI.Application Doctest</title>
|
||||||
|
|
||||||
<script src="../3rdparty/pixi/pixi.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<h1>PIXI.Application with nothing!</h1>
|
<h1>PIXI.Application with nothing!</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Badge</h1>
|
<h1>Badge</h1>
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
<title>PIXI BlurFilter</title>
|
<title>PIXI BlurFilter</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>BlurFilter</h1>
|
<h1>BlurFilter</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Button</h1>
|
<h1>Button</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>ButtonGroup</h1>
|
<h1>ButtonGroup</h1>
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>PIXI Coordinates Doctest</title>
|
<title>PIXI Coordinates Doctest</title>
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 363 KiB After Width: | Height: | Size: 363 KiB |
@@ -0,0 +1,219 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
|
||||||
|
<title>DeepZoomImage Doctests</title>
|
||||||
|
|
||||||
|
<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="../../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
|
<script src="../../../dist/iwmlib.js"></script>
|
||||||
|
<script src="../../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
#app {
|
||||||
|
display: table;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
#app > * {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body onload="Doctest.run()">
|
||||||
|
<h1>Double DeepZoomImage</h1>
|
||||||
|
<p>
|
||||||
|
The main class of a deeply zoomable image that is represented by a hierarchy of tile layers for each zoom level. This gives
|
||||||
|
the user the impression that even huge pictures (up to gigapixel-images) can be zoomed instantaneously, since the
|
||||||
|
tiles at smaller levels are scaled immediately and overloaded by more detailed tiles at the larger level as fast
|
||||||
|
as possible.
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
<div id="div1" style="float: left;"></div>
|
||||||
|
<div id="div2" style="float: right;"></div>
|
||||||
|
<div style="clear: left; margin-top: 540px;" />
|
||||||
|
<script class="doctest">
|
||||||
|
|
||||||
|
// deepZoom
|
||||||
|
//--------------------
|
||||||
|
const deepZoomInfo = new DeepZoomInfo({
|
||||||
|
"tileSize": 128,
|
||||||
|
"format": "jpg",
|
||||||
|
"overlap": 0,
|
||||||
|
"type": "map",
|
||||||
|
"height": 4096,
|
||||||
|
"width": 4096,
|
||||||
|
"path": "../assets/maps/test",
|
||||||
|
"urlTileTemplate": "{path}/{level}/{column}/{row}.{format}"
|
||||||
|
})
|
||||||
|
// const deepZoomInfo = new DeepZoomInfo({
|
||||||
|
// compression: [
|
||||||
|
// "dds"
|
||||||
|
// ],
|
||||||
|
// clip: {
|
||||||
|
// minLevel: 12,
|
||||||
|
// maxLevel: 20,
|
||||||
|
// startCol: 275215,
|
||||||
|
// startRow: 181050,
|
||||||
|
// bounds: {
|
||||||
|
// min: [48.458353, 8.96484374976547],
|
||||||
|
// max: [48.5747899110263, 9.14062499976523]
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// tileSize: 512,
|
||||||
|
// format: "png",
|
||||||
|
// overlap: 0,
|
||||||
|
// type: "map",
|
||||||
|
// height: 131072,
|
||||||
|
// width: 131072,
|
||||||
|
// path: "../../../var/tuesch/luftbild_2016_full",
|
||||||
|
// urlTileTemplate: "{path}/{level}/{row}/{column}.{format}"
|
||||||
|
// })
|
||||||
|
|
||||||
|
// app
|
||||||
|
//--------------------
|
||||||
|
window.app = new PIXIApp({
|
||||||
|
width: 400,
|
||||||
|
height: 500,
|
||||||
|
backgroundColor: 0xFFCCCCCC
|
||||||
|
}).setup().run()
|
||||||
|
|
||||||
|
div1.appendChild(app.view)
|
||||||
|
|
||||||
|
// create the ScatterContainer
|
||||||
|
//--------------------
|
||||||
|
const scatterContainer1 = new ScatterContainer(app.renderer, {showBounds: true, app: app})
|
||||||
|
app.scene.addChild(scatterContainer1)
|
||||||
|
|
||||||
|
// Create the DeepZoomImage
|
||||||
|
//--------------------
|
||||||
|
setTimeout(() => {
|
||||||
|
const deepZoomImage1 = new DeepZoomImage(deepZoomInfo, {app, world: scatterContainer1})
|
||||||
|
deepZoomImage1.scatter = new DisplayObjectScatter(deepZoomImage1, app.renderer, {
|
||||||
|
minScale: 0,
|
||||||
|
maxScale: 50,
|
||||||
|
onTransform: event => {
|
||||||
|
//console.log('currentLevel', deepZoomImage1.currentLevel)
|
||||||
|
deepZoomImage1.transformed(event)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
scatterContainer1.addChild(deepZoomImage1)
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
|
||||||
|
// app2
|
||||||
|
//--------------------
|
||||||
|
const app2 = new PIXIApp({
|
||||||
|
width: 400,
|
||||||
|
height: 500,
|
||||||
|
backgroundColor: 0xFFCCCCCC
|
||||||
|
}).setup().run()
|
||||||
|
|
||||||
|
div2.appendChild(app2.view)
|
||||||
|
|
||||||
|
// create the ScatterContainer
|
||||||
|
//--------------------
|
||||||
|
const scatterContainer2 = new ScatterContainer(app2.renderer, {showBounds: true, app: app2})
|
||||||
|
app2.scene.addChild(scatterContainer2)
|
||||||
|
|
||||||
|
// Create the DeepZoomImage
|
||||||
|
//--------------------
|
||||||
|
const deepZoomImage2 = new DeepZoomImage(deepZoomInfo, {app: app2})
|
||||||
|
deepZoomImage2.scatter = new DisplayObjectScatter(deepZoomImage2, app2.renderer, {
|
||||||
|
minScale: 0,
|
||||||
|
maxScale: 100,
|
||||||
|
onTransform: (event) => {
|
||||||
|
deepZoomImage2.transformed(event)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
scatterContainer2.addChild(deepZoomImage2)
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h1>DeepZoomImage in DeepZoomImage</h1>
|
||||||
|
<p>
|
||||||
|
The main class of a deeply zoomable image that is represented by a hierarchy of tile layers for each zoom level. This gives
|
||||||
|
the user the impression that even huge pictures (up to gigapixel-images) can be zoomed instantaneously, since the
|
||||||
|
tiles at smaller levels are scaled immediately and overloaded by more detailed tiles at the larger level as fast
|
||||||
|
as possible.
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
<div id="div3"></div>
|
||||||
|
<script class="doctest">
|
||||||
|
|
||||||
|
// app3
|
||||||
|
//--------------------
|
||||||
|
const app3 = new PIXIApp({
|
||||||
|
width: 900,
|
||||||
|
height: 500,
|
||||||
|
backgroundColor: 0xFFCCCCCC
|
||||||
|
}).setup().run()
|
||||||
|
|
||||||
|
window.app3 = app3
|
||||||
|
|
||||||
|
div3.appendChild(app3.view)
|
||||||
|
|
||||||
|
// create the ScatterContainer
|
||||||
|
//--------------------
|
||||||
|
const scatterContainer3 = new ScatterContainer(app3.renderer, {app: app3, showBounds: true, claimEvent: false, stopEvents: false})
|
||||||
|
app3.scene.addChild(scatterContainer3)
|
||||||
|
|
||||||
|
// Create the DeepZoomImage
|
||||||
|
//--------------------
|
||||||
|
const deepZoomImage3 = new DeepZoomImage(deepZoomInfo, {app: app3})
|
||||||
|
deepZoomImage3.scatter = new DisplayObjectScatter(deepZoomImage3, app3.renderer, {
|
||||||
|
minScale: 0,
|
||||||
|
maxScale: 100,
|
||||||
|
startScale: 2,
|
||||||
|
autoBringToFront: false,
|
||||||
|
onTransform: (event) => {
|
||||||
|
deepZoomImage3.transformed(event)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
app3._deepZoomImage3 = deepZoomImage3
|
||||||
|
|
||||||
|
scatterContainer3.addChild(deepZoomImage3)
|
||||||
|
|
||||||
|
// Create the second DeepZoomImage
|
||||||
|
//--------------------
|
||||||
|
const border = new PIXI.Graphics()
|
||||||
|
border.beginFill(0x282828, 1)
|
||||||
|
border.drawRect(0, 0, 264, 244)
|
||||||
|
scatterContainer3.addChild(border)
|
||||||
|
|
||||||
|
const mask = new PIXI.Graphics()
|
||||||
|
mask.beginFill(0x282828, 1)
|
||||||
|
mask.drawRect(0, 0, 260, 240)
|
||||||
|
scatterContainer3.addChild(mask)
|
||||||
|
|
||||||
|
const deepZoomImage4 = new DeepZoomImage(deepZoomInfo, {app: app3})
|
||||||
|
deepZoomImage4.x = 4
|
||||||
|
deepZoomImage4.y = 4
|
||||||
|
deepZoomImage4.scatter = new DisplayObjectScatter(deepZoomImage4, app3.renderer, {
|
||||||
|
minScale: 0,
|
||||||
|
maxScale: 100,
|
||||||
|
onTransform: (event) => {
|
||||||
|
deepZoomImage4.transformed(event)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
deepZoomImage4.mask = mask
|
||||||
|
|
||||||
|
app3._deepZoomImage4 = deepZoomImage4
|
||||||
|
|
||||||
|
scatterContainer3.addChild(deepZoomImage4)
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@@ -10,11 +10,10 @@
|
|||||||
<link rel="stylesheet" href="../../../css/doctest.css">
|
<link rel="stylesheet" href="../../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../3rdparty/all.js"></script>
|
<script src="../../../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
|
|
||||||
|
|
||||||
<script src="../../all.js"></script>
|
<script src="../../../dist/iwmlib.js"></script>
|
||||||
<script src="../all.js"></script>
|
<script src="../../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
#app {
|
#app {
|
||||||
|
|||||||
@@ -1,25 +1,12 @@
|
|||||||
import { Capabilities } from '../../capabilities.js'
|
import { Capabilities } from '../../capabilities.js'
|
||||||
import { Points } from '../../utils.js'
|
import { Points } from '../../utils.js'
|
||||||
import { deepZoomTileCache } from './tile.js'
|
import Tile from './tile.js'
|
||||||
import { Tiles } from './tiles.js'
|
import { Tiles } from './tiles.js'
|
||||||
|
|
||||||
function isEven(n) {
|
function isEven(n) {
|
||||||
return n % 2 == 0
|
return n % 2 == 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function printTileCacheInfos() {
|
|
||||||
let references = new Map()
|
|
||||||
let multiples = 0
|
|
||||||
for (let [url, tiles] of deepZoomTileCache.entries()) {
|
|
||||||
let count = tiles.size
|
|
||||||
references.set(url, count)
|
|
||||||
if (count > 1) {
|
|
||||||
multiples += 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
console.log({ multiples, references })
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* A utility class that holds information typically provided by DZI files, i.e.
|
* A utility class that holds information typically provided by DZI files, i.e.
|
||||||
* height and width of the overall image, overlap, and image type.
|
* height and width of the overall image, overlap, and image type.
|
||||||
@@ -374,6 +361,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
: 1
|
: 1
|
||||||
this.alpha = alpha
|
this.alpha = alpha
|
||||||
this.fastLoads = 0
|
this.fastLoads = 0
|
||||||
|
this.active = true
|
||||||
this.autoLoadTiles = autoLoadTiles
|
this.autoLoadTiles = autoLoadTiles
|
||||||
this.minimumLevel = minimumLevel
|
this.minimumLevel = minimumLevel
|
||||||
this.quadTrees = new Map() // url as keys, TileQuadNodes as values
|
this.quadTrees = new Map() // url as keys, TileQuadNodes as values
|
||||||
@@ -424,7 +412,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
this.minimumLevel = deepZoomInfo.baseLevel
|
this.minimumLevel = deepZoomInfo.baseLevel
|
||||||
}
|
}
|
||||||
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
this.currentLevel = Math.max(this.minimumLevel, deepZoomInfo.baseLevel)
|
||||||
console.log("autoLoadTiles", this.autoLoadTiles)
|
//console.log("autoLoadTiles", this.autoLoadTiles)
|
||||||
if (this.autoLoadTiles) {
|
if (this.autoLoadTiles) {
|
||||||
this.setupTiles(center)
|
this.setupTiles(center)
|
||||||
}
|
}
|
||||||
@@ -645,9 +633,9 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
worldBounds() {
|
worldBounds() {
|
||||||
let viewBounds = this.app.scene.bounds
|
let viewBounds = this.app.scene.bounds || this.app.scene.getBounds()
|
||||||
// Using getBounds extends visible scope after loading tiles and leads
|
// Using getBounds extends visible scope after loading tiles and leads
|
||||||
// to excessive loading
|
// to excessive loading. So we prefer bounds over getBounds()
|
||||||
if (this.world != null) {
|
if (this.world != null) {
|
||||||
let bounds = this.world.bounds
|
let bounds = this.world.bounds
|
||||||
let x = Math.max(-bounds.width, bounds.x)
|
let x = Math.max(-bounds.width, bounds.x)
|
||||||
@@ -1027,6 +1015,9 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
* @param {boolean} debug - log debug infos
|
* @param {boolean} debug - log debug infos
|
||||||
*/
|
*/
|
||||||
transformed(event) {
|
transformed(event) {
|
||||||
|
if (!this.active) {
|
||||||
|
return
|
||||||
|
}
|
||||||
let key = this.currentLevel.toString()
|
let key = this.currentLevel.toString()
|
||||||
let currentTiles = this.tileLayers[key]
|
let currentTiles = this.tileLayers[key]
|
||||||
if (typeof currentTiles == 'undefined') {
|
if (typeof currentTiles == 'undefined') {
|
||||||
@@ -1074,6 +1065,7 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
activate() {
|
activate() {
|
||||||
|
this.active = true
|
||||||
this.destroyTilesAboveLevel(this.currentLevel)
|
this.destroyTilesAboveLevel(this.currentLevel)
|
||||||
this.ensureTiles(this.currentLevel, null)
|
this.ensureTiles(this.currentLevel, null)
|
||||||
//console.log("Activate Textures!", this.currentLevel)
|
//console.log("Activate Textures!", this.currentLevel)
|
||||||
@@ -1085,34 +1077,18 @@ export class DeepZoomImage extends PIXI.Container {
|
|||||||
* @memberof DeepZoomImage
|
* @memberof DeepZoomImage
|
||||||
*/
|
*/
|
||||||
deactivate() {
|
deactivate() {
|
||||||
|
this.active = false
|
||||||
this.destroyAllTiles()
|
this.destroyAllTiles()
|
||||||
Object.keys(this.tileLayers).forEach(key => {
|
|
||||||
this.destroyTiles(key)
|
|
||||||
})
|
|
||||||
this.tileContainer.destroy({ children: true })
|
this.tileContainer.destroy({ children: true })
|
||||||
printTileCacheInfos()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
throwFinished() {
|
throwFinished() {
|
||||||
console.log("throwFinished")
|
//console.log("throwFinished")
|
||||||
let key = this.currentLevel.toString()
|
let key = this.currentLevel.toString()
|
||||||
let currentTiles = this.tileLayers[key]
|
let currentTiles = this.tileLayers[key]
|
||||||
if (typeof currentTiles == 'undefined') {
|
if (typeof currentTiles == 'undefined') {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
this.ensureTiles(this.currentLevel)
|
this.ensureTiles(this.currentLevel)
|
||||||
// let all = new Set()
|
|
||||||
// for (let tile of currentTiles.children) {
|
|
||||||
// all.add(tile.url)
|
|
||||||
// }
|
|
||||||
// let { centerCol, centerRow, needed } = this.neededTiles(currentTiles, this.currentLevel)
|
|
||||||
// for (let [url, col, row] of needed) {
|
|
||||||
// all.delete(url)
|
|
||||||
// }
|
|
||||||
// for (let url of all) {
|
|
||||||
// currentTiles.destroyTileByUrl(url)
|
|
||||||
// }
|
|
||||||
// currentTiles.loader.loader.reset()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,219 +1,38 @@
|
|||||||
<!doctype html>
|
<html>
|
||||||
<html lang="en">
|
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<title>PIXI Lib Doctests</title>
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
||||||
|
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||||
|
<link rel="stylesheet" href="../../../css/index.css">
|
||||||
|
|
||||||
<title>DeepZoomImage Doctests</title>
|
<script src="../../../dist/iwmlib.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../3rdparty/highlight/styles/default.css">
|
<template id="itemTemplate">
|
||||||
<link rel="stylesheet" href="../../../css/doctest.css">
|
<a class="wrapper" href="">
|
||||||
|
<div class="preview">
|
||||||
<script src="../../3rdparty/highlight/highlight.pack.js"></script>
|
<div class="thumbnail-container">
|
||||||
<script src="../../3rdparty/all.js"></script>
|
<div class="thumbnail">
|
||||||
<script src="../../../node_modules/jquery/dist/jquery.min.js"></script>
|
<img class="icon" >
|
||||||
|
<!-- <iframe src="" frameborder="0"></iframe> -->
|
||||||
<script src="../../all.js"></script>
|
</div>
|
||||||
<script src="../all.js"></script>
|
</div>
|
||||||
|
<div class="title"></div>
|
||||||
<style>
|
</div>
|
||||||
#app {
|
</a>
|
||||||
display: table;
|
</template>
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
#app > * {
|
|
||||||
margin-bottom: 5px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
</head>
|
||||||
|
<body>
|
||||||
|
<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'],
|
||||||
|
['Image', 'image.html'],
|
||||||
|
|
||||||
<body onload="Doctest.run()">
|
],
|
||||||
<h1>Double DeepZoomImage</h1>
|
null)
|
||||||
<p>
|
index.load()
|
||||||
The main class of a deeply zoomable image that is represented by a hierarchy of tile layers for each zoom level. This gives
|
</script>
|
||||||
the user the impression that even huge pictures (up to gigapixel-images) can be zoomed instantaneously, since the
|
|
||||||
tiles at smaller levels are scaled immediately and overloaded by more detailed tiles at the larger level as fast
|
|
||||||
as possible.
|
|
||||||
</p>
|
|
||||||
<br />
|
|
||||||
<div id="div1" style="float: left;"></div>
|
|
||||||
<div id="div2" style="float: right;"></div>
|
|
||||||
<div style="clear: left; margin-top: 540px;" />
|
|
||||||
<script class="doctest">
|
|
||||||
|
|
||||||
// deepZoom
|
|
||||||
//--------------------
|
|
||||||
const deepZoomInfo = new DeepZoomInfo({
|
|
||||||
"tileSize": 128,
|
|
||||||
"format": "jpg",
|
|
||||||
"overlap": 0,
|
|
||||||
"type": "map",
|
|
||||||
"height": 4096,
|
|
||||||
"width": 4096,
|
|
||||||
"path": "../assets/maps/test",
|
|
||||||
"urlTileTemplate": "{path}/{level}/{column}/{row}.{format}"
|
|
||||||
})
|
|
||||||
// const deepZoomInfo = new DeepZoomInfo({
|
|
||||||
// compression: [
|
|
||||||
// "dds"
|
|
||||||
// ],
|
|
||||||
// clip: {
|
|
||||||
// minLevel: 12,
|
|
||||||
// maxLevel: 20,
|
|
||||||
// startCol: 275215,
|
|
||||||
// startRow: 181050,
|
|
||||||
// bounds: {
|
|
||||||
// min: [48.458353, 8.96484374976547],
|
|
||||||
// max: [48.5747899110263, 9.14062499976523]
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// tileSize: 512,
|
|
||||||
// format: "png",
|
|
||||||
// overlap: 0,
|
|
||||||
// type: "map",
|
|
||||||
// height: 131072,
|
|
||||||
// width: 131072,
|
|
||||||
// path: "../../../var/tuesch/luftbild_2016_full",
|
|
||||||
// urlTileTemplate: "{path}/{level}/{row}/{column}.{format}"
|
|
||||||
// })
|
|
||||||
|
|
||||||
// app
|
|
||||||
//--------------------
|
|
||||||
window.app = new PIXIApp({
|
|
||||||
width: 400,
|
|
||||||
height: 500,
|
|
||||||
backgroundColor: 0xFFCCCCCC
|
|
||||||
}).setup().run()
|
|
||||||
|
|
||||||
div1.appendChild(app.view)
|
|
||||||
|
|
||||||
// create the ScatterContainer
|
|
||||||
//--------------------
|
|
||||||
const scatterContainer1 = new ScatterContainer(app.renderer, {showBounds: true, app: app})
|
|
||||||
app.scene.addChild(scatterContainer1)
|
|
||||||
|
|
||||||
// Create the DeepZoomImage
|
|
||||||
//--------------------
|
|
||||||
setTimeout(() => {
|
|
||||||
const deepZoomImage1 = new DeepZoomImage(deepZoomInfo, {app, world: scatterContainer1})
|
|
||||||
deepZoomImage1.scatter = new DisplayObjectScatter(deepZoomImage1, app.renderer, {
|
|
||||||
minScale: 0,
|
|
||||||
maxScale: 50,
|
|
||||||
onTransform: event => {
|
|
||||||
console.log('currentLevel', deepZoomImage1.currentLevel)
|
|
||||||
deepZoomImage1.transformed(event)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
scatterContainer1.addChild(deepZoomImage1)
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
|
|
||||||
// app2
|
|
||||||
//--------------------
|
|
||||||
const app2 = new PIXIApp({
|
|
||||||
width: 400,
|
|
||||||
height: 500,
|
|
||||||
backgroundColor: 0xFFCCCCCC
|
|
||||||
}).setup().run()
|
|
||||||
|
|
||||||
div2.appendChild(app2.view)
|
|
||||||
|
|
||||||
// create the ScatterContainer
|
|
||||||
//--------------------
|
|
||||||
const scatterContainer2 = new ScatterContainer(app2.renderer, {showBounds: true, app: app2})
|
|
||||||
app2.scene.addChild(scatterContainer2)
|
|
||||||
|
|
||||||
// Create the DeepZoomImage
|
|
||||||
//--------------------
|
|
||||||
const deepZoomImage2 = new DeepZoomImage(deepZoomInfo, {app: app2})
|
|
||||||
deepZoomImage2.scatter = new DisplayObjectScatter(deepZoomImage2, app2.renderer, {
|
|
||||||
minScale: 0,
|
|
||||||
maxScale: 100,
|
|
||||||
onTransform: (event) => {
|
|
||||||
deepZoomImage2.transformed(event)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
scatterContainer2.addChild(deepZoomImage2)
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h1>DeepZoomImage in DeepZoomImage</h1>
|
|
||||||
<p>
|
|
||||||
The main class of a deeply zoomable image that is represented by a hierarchy of tile layers for each zoom level. This gives
|
|
||||||
the user the impression that even huge pictures (up to gigapixel-images) can be zoomed instantaneously, since the
|
|
||||||
tiles at smaller levels are scaled immediately and overloaded by more detailed tiles at the larger level as fast
|
|
||||||
as possible.
|
|
||||||
</p>
|
|
||||||
<br />
|
|
||||||
<div id="div3"></div>
|
|
||||||
<script class="doctest">
|
|
||||||
|
|
||||||
// app3
|
|
||||||
//--------------------
|
|
||||||
const app3 = new PIXIApp({
|
|
||||||
width: 900,
|
|
||||||
height: 500,
|
|
||||||
backgroundColor: 0xFFCCCCCC
|
|
||||||
}).setup().run()
|
|
||||||
|
|
||||||
window.app3 = app3
|
|
||||||
|
|
||||||
div3.appendChild(app3.view)
|
|
||||||
|
|
||||||
// create the ScatterContainer
|
|
||||||
//--------------------
|
|
||||||
const scatterContainer3 = new ScatterContainer(app3.renderer, {app: app3, showBounds: true, claimEvent: false, stopEvents: false})
|
|
||||||
app3.scene.addChild(scatterContainer3)
|
|
||||||
|
|
||||||
// Create the DeepZoomImage
|
|
||||||
//--------------------
|
|
||||||
const deepZoomImage3 = new DeepZoomImage(deepZoomInfo, {app: app3})
|
|
||||||
deepZoomImage3.scatter = new DisplayObjectScatter(deepZoomImage3, app3.renderer, {
|
|
||||||
minScale: 0,
|
|
||||||
maxScale: 100,
|
|
||||||
startScale: 2,
|
|
||||||
autoBringToFront: false,
|
|
||||||
onTransform: (event) => {
|
|
||||||
deepZoomImage3.transformed(event)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
app3._deepZoomImage3 = deepZoomImage3
|
|
||||||
|
|
||||||
scatterContainer3.addChild(deepZoomImage3)
|
|
||||||
|
|
||||||
// Create the second DeepZoomImage
|
|
||||||
//--------------------
|
|
||||||
const border = new PIXI.Graphics()
|
|
||||||
border.beginFill(0x282828, 1)
|
|
||||||
border.drawRect(0, 0, 264, 244)
|
|
||||||
scatterContainer3.addChild(border)
|
|
||||||
|
|
||||||
const mask = new PIXI.Graphics()
|
|
||||||
mask.beginFill(0x282828, 1)
|
|
||||||
mask.drawRect(0, 0, 260, 240)
|
|
||||||
scatterContainer3.addChild(mask)
|
|
||||||
|
|
||||||
const deepZoomImage4 = new DeepZoomImage(deepZoomInfo, {app: app3})
|
|
||||||
deepZoomImage4.x = 4
|
|
||||||
deepZoomImage4.y = 4
|
|
||||||
deepZoomImage4.scatter = new DisplayObjectScatter(deepZoomImage4, app3.renderer, {
|
|
||||||
minScale: 0,
|
|
||||||
maxScale: 100,
|
|
||||||
onTransform: (event) => {
|
|
||||||
deepZoomImage4.transformed(event)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
deepZoomImage4.mask = mask
|
|
||||||
|
|
||||||
app3._deepZoomImage4 = deepZoomImage4
|
|
||||||
|
|
||||||
scatterContainer3.addChild(deepZoomImage4)
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { deepZoomTileCache, Tile } from './tile.js'
|
import Tile from './tile.js'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Tile Loader component that can be plugged into a Tiles Layer.
|
* A Tile Loader component that can be plugged into a Tiles Layer.
|
||||||
@@ -28,6 +28,8 @@ export class TileLoader {
|
|||||||
schedule(url, col, row) {
|
schedule(url, col, row) {
|
||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
|
//Tile.schedule(url)
|
||||||
this.map.set(url, [col, row])
|
this.map.set(url, [col, row])
|
||||||
this.loading.add(url)
|
this.loading.add(url)
|
||||||
this.loadQueue.push(url)
|
this.loadQueue.push(url)
|
||||||
@@ -37,6 +39,7 @@ export class TileLoader {
|
|||||||
unschedule(url) {
|
unschedule(url) {
|
||||||
if (this.loaded.has(url)) this.loaded.delete(url)
|
if (this.loaded.has(url)) this.loaded.delete(url)
|
||||||
if (this.loading.has(url)) this.loading.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)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,9 +65,14 @@ export class TileLoader {
|
|||||||
console.warn("Tile already loaded")
|
console.warn("Tile already loaded")
|
||||||
tile.unregister()
|
tile.unregister()
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
tile = new Tile(texture, url)
|
tile = new Tile(texture, url)
|
||||||
this.loaded.set(url, tile)
|
this.loaded.set(url, tile)
|
||||||
this.tiles.tileAvailable(tile, col, row, url)
|
this.tiles.tileAvailable(tile, col, row, url)
|
||||||
|
} catch (error) {
|
||||||
|
console.warn("Tile loading error", error)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,16 +99,13 @@ export class PIXITileLoader extends TileLoader {
|
|||||||
if (this.loaded.has(url)) return false
|
if (this.loaded.has(url)) return false
|
||||||
if (this.loading.has(url)) return false
|
if (this.loading.has(url)) return false
|
||||||
|
|
||||||
if (deepZoomTileCache.has(url)) {
|
//Tile.schedule(url)
|
||||||
let tiles = deepZoomTileCache.get(url)
|
let reusableTexture = Tile.textureAvailable(url)
|
||||||
for (let tile of tiles.values()) {
|
if (reusableTexture) {
|
||||||
//console.log("Reusing cached texture", tile.parent)
|
if (this.debug) console.log('Texture reusable', reusableTexture)
|
||||||
let texture = tile.texture
|
this._textureAvailable(url, col, row, reusableTexture)
|
||||||
this._textureAvailable(url, col, row, texture)
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let texture = PIXI.utils.TextureCache[url]
|
let texture = PIXI.utils.TextureCache[url]
|
||||||
if (texture) {
|
if (texture) {
|
||||||
if (this.debug) console.log('Texture already loaded', texture)
|
if (this.debug) console.log('Texture already loaded', texture)
|
||||||
@@ -155,8 +160,8 @@ export class PIXITileLoader extends TileLoader {
|
|||||||
_onLoaded(loader, resource) {
|
_onLoaded(loader, resource) {
|
||||||
if (this.destroyed) {
|
if (this.destroyed) {
|
||||||
let texture = resource.texture
|
let texture = resource.texture
|
||||||
let destroyBase = !deepZoomTileCache.has(resource.url)
|
let url = resource.url
|
||||||
texture.destroy(destroyBase)
|
Tile.lateTexture(url, texture)
|
||||||
console.warn("Received resource after destroy", texture)
|
console.warn("Received resource after destroy", texture)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<!-- disable zooming -->
|
<!-- disable zooming -->
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1">
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1, maximum-scale=1">
|
||||||
|
|
||||||
<script src="../../../lib/3rdparty/all.js"></script>
|
<script src="../.././3rdparty/all.js"></script>
|
||||||
<script src="../../../lib/all.js"></script>
|
<script src="../../../lib/all.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../test/lib/bulma.css">
|
<link rel="stylesheet" href="../test/lib/bulma.css">
|
||||||
|
|||||||
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 40 KiB |
@@ -1,19 +1,66 @@
|
|||||||
|
/* ES Lint */
|
||||||
|
/* globals PIXI, console*/
|
||||||
|
|
||||||
export const deepZoomTileCache = new Map()
|
const registeredTiles = new Map()
|
||||||
|
/** Implements a baseTexture cache. The last textures are kept for reuse */
|
||||||
|
let keepTextures = 0
|
||||||
|
const keptTextures = []
|
||||||
|
const lateTextures = new Map()
|
||||||
|
let lastSweepTime = 0
|
||||||
|
let sweepInterval = 2000.0
|
||||||
|
|
||||||
/** The current Tile implementation simply uses PIXI.Sprites.
|
/** The current Tile implementation simply uses PIXI.Sprites.
|
||||||
*
|
*
|
||||||
* BTW: PIXI.extras.TilingSprite is not appropriate. It should be used for
|
* BTW: PIXI.extras.TilingSprite is not appropriate. It should be used for
|
||||||
* repeating patterns.
|
* repeating patterns.
|
||||||
**/
|
**/
|
||||||
export class Tile extends PIXI.Sprite {
|
export default class Tile extends PIXI.Sprite {
|
||||||
constructor(texture, url) {
|
constructor(texture, url) {
|
||||||
super(texture)
|
super(texture)
|
||||||
this.url = url
|
this.url = url
|
||||||
this.register(url)
|
this.register(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Static method to enable keeping of base textures
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} value
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static enableKeepTextures(value = 1000) {
|
||||||
|
keepTextures = value
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true iff the url is pending
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
/*static isPending(url) {
|
||||||
|
return pendingTiles.has(url) && pendingTiles.get(url) > 0
|
||||||
|
} */
|
||||||
|
|
||||||
|
static isObsolete(url) {
|
||||||
|
if (registeredTiles.has(url) && registeredTiles.get(url) > 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads a tile from image using the PIXI.Texture.fromImage method.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @param {*} imageId
|
||||||
|
* @param {*} crossorigin
|
||||||
|
* @param {*} scaleMode
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
static fromImage(imageId, crossorigin, scaleMode) {
|
static fromImage(imageId, crossorigin, scaleMode) {
|
||||||
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
return new Tile(PIXI.Texture.fromImage(imageId, crossorigin, scaleMode), imageId)
|
||||||
}
|
}
|
||||||
@@ -26,13 +73,14 @@ export class Tile extends PIXI.Sprite {
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
register(url, debug = false) {
|
register(url, debug = false) {
|
||||||
if (deepZoomTileCache.has(url)) {
|
//Tile.unschedule(url)
|
||||||
let tiles = deepZoomTileCache.get(url)
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url)
|
||||||
tiles.add(this)
|
tiles.add(this)
|
||||||
if (debug) console.log("Tile.register", url, tiles.size)
|
if (debug) console.log("Tile.register", url, tiles.size)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deepZoomTileCache.set(url, new Set([this]))
|
registeredTiles.set(url, new Set([this]))
|
||||||
if (debug) console.log("Tile.register", url, 1)
|
if (debug) console.log("Tile.register", url, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -44,10 +92,11 @@ export class Tile extends PIXI.Sprite {
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
unregister() {
|
unregister() {
|
||||||
let tiles = deepZoomTileCache.get(this.url)
|
let tiles = registeredTiles.get(this.url)
|
||||||
tiles.delete(this)
|
tiles.delete(this)
|
||||||
if (tiles.size == 0) {
|
if (tiles.size == 0) {
|
||||||
deepZoomTileCache.delete(this.url)
|
registeredTiles.delete(this.url)
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
return tiles.size
|
return tiles.size
|
||||||
}
|
}
|
||||||
@@ -59,19 +108,127 @@ export class Tile extends PIXI.Sprite {
|
|||||||
* @memberof Tile
|
* @memberof Tile
|
||||||
*/
|
*/
|
||||||
destroy(options, debug = false) {
|
destroy(options, debug = false) {
|
||||||
if (this.parent != null) {
|
|
||||||
|
|
||||||
}
|
|
||||||
let count = this.unregister()
|
let count = this.unregister()
|
||||||
if (count <= 0) {
|
|
||||||
|
if (keepTextures > 0) {
|
||||||
|
keptTextures.push({ url: this.url, texture: this.texture })
|
||||||
|
|
||||||
|
let opts = { children: true, texture: false, baseTexture: false }
|
||||||
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
||||||
|
super.destroy(opts)
|
||||||
|
|
||||||
|
while (keptTextures.length > keepTextures) {
|
||||||
|
let { url, texture } = keptTextures.shift()
|
||||||
|
if (Tile.isObsolete(url)) {
|
||||||
|
texture.destroy(true) // Destroy base as well
|
||||||
|
if (debug) console.log("Destroying texture and baseTexture", url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// No longer registered and not pending
|
||||||
|
if (count <= 0) { // && !Tile.isPending(this.url)
|
||||||
let opts = { children: true, texture: true, baseTexture: true }
|
let opts = { children: true, texture: true, baseTexture: true }
|
||||||
super.destroy(opts)
|
super.destroy(opts)
|
||||||
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts)
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let opts = { children: true, texture: false, baseTexture: false }
|
let opts = { children: true, texture: false, baseTexture: false }
|
||||||
if (debug) console.log("Tile.destroy", deepZoomTileCache.size, opts)
|
if (debug) console.log("Tile.destroy", registeredTiles.size, opts)
|
||||||
super.destroy(opts)
|
super.destroy(opts)
|
||||||
}
|
}
|
||||||
|
if (this.parent != null) {
|
||||||
|
// UO: Emit warning and remove
|
||||||
|
console.warn("Destroying tile with parent. Hiding instead")
|
||||||
|
this.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an available texture that can be reused
|
||||||
|
*
|
||||||
|
* @param {*} url
|
||||||
|
* @returns
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static textureAvailable(url) {
|
||||||
|
if (registeredTiles.has(url)) {
|
||||||
|
let tiles = registeredTiles.get(url)
|
||||||
|
for (let tile of tiles.values()) {
|
||||||
|
//console.log("Reusing cached texture", tile.parent)
|
||||||
|
return tile.texture
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Specialized renderWebGL to avoid freezing system
|
||||||
|
*
|
||||||
|
* @param {*} renderer
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
renderWebGL(renderer) {
|
||||||
|
try {
|
||||||
|
super.renderWebGL(renderer)
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
// We want persistent logging here
|
||||||
|
Logging.error("Error in Tile.renderWebGL: " + e.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes lately arrived texture if they have not been touched in the meanwhile.
|
||||||
|
*
|
||||||
|
* @static
|
||||||
|
* @memberof Tile
|
||||||
|
*/
|
||||||
|
static sweepLateTextures() {
|
||||||
|
let now = performance.now()
|
||||||
|
if (now > lastSweepTime + sweepInterval) {
|
||||||
|
lastSweepTime = now
|
||||||
|
let count = 0
|
||||||
|
for (let [url, texture] of lateTextures.entries()) {
|
||||||
|
if (texture) {
|
||||||
|
let base = texture.baseTexture
|
||||||
|
if (base != null && base.touched == 0) {
|
||||||
|
texture.destroy(true)
|
||||||
|
//console.info("Sweeping ", url)
|
||||||
|
count += 1
|
||||||
|
lateTextures.delete(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (count > 0)
|
||||||
|
console.log("Sweeping textures", count)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Texture received too late. We do not need it.
|
||||||
|
* @param {*} url
|
||||||
|
* @param {*} texture
|
||||||
|
*/
|
||||||
|
static lateTexture(url, texture) {
|
||||||
|
lateTextures.set(url, texture)
|
||||||
|
//console.warn("Tile.lateTexture")
|
||||||
|
// We cannot destroy the texture since we got errors in t.renderWebGL.
|
||||||
|
// Perhaps we can destroy unsed textures later on
|
||||||
|
Tile.sweepLateTextures()
|
||||||
|
}
|
||||||
|
|
||||||
|
static printInfos() {
|
||||||
|
let references = new Map()
|
||||||
|
let multiples = 0
|
||||||
|
for (let [url, tiles] of registeredTiles.entries()) {
|
||||||
|
let count = tiles.size
|
||||||
|
references.set(url, count)
|
||||||
|
if (count > 1) {
|
||||||
|
multiples += 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log({ multiples, references })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>PIXI Flip Effect Doctest</title>
|
<title>PIXI Flip Effect Doctest</title>
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../css/flipeffect.css">
|
<link rel="stylesheet" href="../../css/flipeffect.css">
|
||||||
<template id="flipTemplate">
|
<template id="flipTemplate">
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
|
<script src="../3rdparty/gsap/src/minified/TweenMax.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Flippable</h1>
|
<h1>Flippable</h1>
|
||||||
|
|||||||
@@ -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 {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.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 {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 {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 {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).
|
* @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,
|
shadow: false,
|
||||||
eulerX: 0,
|
eulerX: 0,
|
||||||
eulerY: 0,
|
eulerY: 0,
|
||||||
eulerEase: Sine.easeOut,
|
eulerEase: Power1.easeOut,
|
||||||
useBackTransforms: false,
|
useBackTransforms: false,
|
||||||
transformEase: Power2.easeOut,
|
transformEase: Power2.easeOut,
|
||||||
focus: 800,
|
focus: 800,
|
||||||
|
|||||||
@@ -7,9 +7,9 @@
|
|||||||
<link rel="stylesheet" href="../3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="../3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run();" >
|
<body onload="Doctest.run();" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
<script src="./lib/graphology.min.js"></script>
|
<script src="./lib/graphology.min.js"></script>
|
||||||
<script src="./lib/graphology-layout-forceatlas2.js"></script>
|
<script src="./lib/graphology-layout-forceatlas2.js"></script>
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
|
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0" />
|
||||||
<link rel="stylesheet" href="../../css/index.css">
|
<link rel="stylesheet" href="../../css/index.css">
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
|
|
||||||
<template id="itemTemplate">
|
<template id="itemTemplate">
|
||||||
<a class="wrapper" href="">
|
<a class="wrapper" href="">
|
||||||
<div class="preview">
|
<div class="preview">
|
||||||
<div class="thumbnail-container">
|
<div class="thumbnail-container">
|
||||||
<div class="thumbnail">
|
<div class="thumbnail">
|
||||||
<img class="icon" >
|
<img class="icon" src="thumbnails/notfound.png">
|
||||||
<!-- <iframe src="" frameborder="0"></iframe> -->
|
<!-- <iframe src="" frameborder="0"></iframe> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -22,8 +22,9 @@
|
|||||||
</template>
|
</template>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="container" class="container">
|
<div id="container" class="container">
|
||||||
</div>
|
<a style="position: absolute; left: 22px; top: 12px;" target="_blank" href="http://www.iwm-tuebingen.de">IWM</a>
|
||||||
|
</div>
|
||||||
<script>
|
<script>
|
||||||
const index = new Index(itemTemplate, [
|
const index = new Index(itemTemplate, [
|
||||||
['PIXI.Application', 'application.html'],
|
['PIXI.Application', 'application.html'],
|
||||||
@@ -32,8 +33,7 @@ const index = new Index(itemTemplate, [
|
|||||||
['Button', 'button.html'],
|
['Button', 'button.html'],
|
||||||
['ButtonGroup', 'buttongroup.html'],
|
['ButtonGroup', 'buttongroup.html'],
|
||||||
['Coordinates', 'coordinates.html'],
|
['Coordinates', 'coordinates.html'],
|
||||||
['DeepZoom', 'deepzoom.html'],
|
['DeepZoom', 'deepzoom/index.html'],
|
||||||
['DeepZoomImage', 'deepzoomimage.html'],
|
|
||||||
['Flippable', 'flippable.html'],
|
['Flippable', 'flippable.html'],
|
||||||
['LabeledGraphics', 'labeledgraphics.html'],
|
['LabeledGraphics', 'labeledgraphics.html'],
|
||||||
['List', 'list.html'],
|
['List', 'list.html'],
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>LabeledGraphics</h1>
|
<h1>LabeledGraphics</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Message</h1>
|
<h1>Message</h1>
|
||||||
|
|||||||
@@ -9,10 +9,9 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<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>
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
<script src="./all.js"></script>
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Modal</h1>
|
<h1>Modal</h1>
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>Popover</h1>
|
<h1>Popover</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Popup</h1>
|
<h1>Popup</h1>
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
|
|
||||||
<title>PIXI PopupMenu</title>
|
<title>PIXI PopupMenu</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>PopupMenu</h1>
|
<h1>PopupMenu</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Progress</h1>
|
<h1>Progress</h1>
|
||||||
|
|||||||
@@ -4,13 +4,13 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>PIXI Scatter Doctest</title>
|
<title>PIXI Scatter Doctest</title>
|
||||||
<link rel="stylesheet" href="../../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href=".././3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
<script src="../../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src=".././3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Slider</h1>
|
<h1>Slider</h1>
|
||||||
|
|||||||
@@ -9,10 +9,12 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
|
|
||||||
|
<script src="../3rdparty/d3.min.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Text</h1>
|
<h1>Text</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Theme</h1>
|
<h1>Theme</h1>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 43 KiB |
|
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 384 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 518 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 841 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 501 KiB After Width: | Height: | Size: 61 KiB |
|
Before Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 596 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 222 KiB After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 188 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 226 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 537 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 282 KiB After Width: | Height: | Size: 92 KiB |
|
Before Width: | Height: | Size: 247 KiB After Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 494 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 429 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 475 KiB After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 107 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 489 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 29 KiB |
|
Before Width: | Height: | Size: 709 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 25 KiB |
@@ -1,6 +1,6 @@
|
|||||||
import { Cycle, Colors, Dates, isEmpty } from '../utils.js'
|
import { Cycle, Colors, Dates, isEmpty } from '../utils.js'
|
||||||
import { Capabilities } from '../capabilities.js'
|
import { Capabilities } from '../capabilities.js'
|
||||||
import { BitmapLabeledGraphics, LabeledGraphics, FontInfo } from './labeledgraphics.js'
|
import { BitmapLabeledGraphics, FontInfo } from './labeledgraphics.js'
|
||||||
|
|
||||||
|
|
||||||
export class Ticks {
|
export class Ticks {
|
||||||
@@ -9,6 +9,10 @@ export class Ticks {
|
|||||||
return ['decade', 'year', 'month', 'day', 'hour', 'minute', 'second']
|
return ['decade', 'year', 'month', 'day', 'hour', 'minute', 'second']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static get largeTickSize() {
|
||||||
|
return 4.2
|
||||||
|
}
|
||||||
|
|
||||||
get minWidth() {
|
get minWidth() {
|
||||||
return 10
|
return 10
|
||||||
}
|
}
|
||||||
@@ -83,7 +87,7 @@ export class Ticks {
|
|||||||
return date.toLocaleDateString('de', format)
|
return date.toLocaleDateString('de', format)
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(timeline, range, width, height, available, format, nextFormat, level) {
|
draw(timeline, range, width, height, available, format, nextFormat, level, extraTicks=false) {
|
||||||
let first = null
|
let first = null
|
||||||
let last = null
|
let last = null
|
||||||
let keyedFormat = (format) ? format[this.formatKey] : null
|
let keyedFormat = (format) ? format[this.formatKey] : null
|
||||||
@@ -91,7 +95,6 @@ export class Ticks {
|
|||||||
let redundant = (nextFormat) ? this.formatKey in nextFormat : false
|
let redundant = (nextFormat) ? this.formatKey in nextFormat : false
|
||||||
let fullyRedundant = keyedFormat != null && keyedFormat == keyedNextFormat
|
let fullyRedundant = keyedFormat != null && keyedFormat == keyedNextFormat
|
||||||
let y = timeline.getY()
|
let y = timeline.getY()
|
||||||
|
|
||||||
for (let { start, end } of this.iterRanges(range)) {
|
for (let { start, end } of this.iterRanges(range)) {
|
||||||
let x = timeline.toX(start)
|
let x = timeline.toX(start)
|
||||||
let xx = x
|
let xx = x
|
||||||
@@ -100,11 +103,10 @@ export class Ticks {
|
|||||||
let key = this.dateKey(start)
|
let key = this.dateKey(start)
|
||||||
let text = this.toLocaleString(start, format)
|
let text = this.toLocaleString(start, format)
|
||||||
let align = 'center'
|
let align = 'center'
|
||||||
let downTick = false
|
|
||||||
if (nextFormat) {
|
if (nextFormat) {
|
||||||
yy = y + timeline.tickLabelOffset(-1, 1)
|
yy = y + timeline.tickLabelOffset(-1, 1)
|
||||||
align = 'left'
|
align = 'left'
|
||||||
timeline.drawTick(x, 4.2)
|
timeline.drawTick(x, Ticks.largeTickSize)
|
||||||
let nextX = timeline.toX(end) - 100
|
let nextX = timeline.toX(end) - 100
|
||||||
if (x < 0 && nextX > -100 && !redundant) {
|
if (x < 0 && nextX > -100 && !redundant) {
|
||||||
xx = Math.min(4, nextX)
|
xx = Math.min(4, nextX)
|
||||||
@@ -112,20 +114,18 @@ export class Ticks {
|
|||||||
else {
|
else {
|
||||||
xx -= 2
|
xx -= 2
|
||||||
}
|
}
|
||||||
downTick = true
|
|
||||||
}
|
}
|
||||||
else if (level > 0) {
|
else if (level > 0) {
|
||||||
xx = x + available / 2
|
xx = x + available / 2
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
downTick = true
|
|
||||||
}
|
|
||||||
if (!fullyRedundant) {
|
if (!fullyRedundant) {
|
||||||
timeline.ensureLabel(key, text,
|
timeline.ensureLabel(key, text,
|
||||||
{ x: xx, y: yy, align },
|
{ x: xx, y: yy, align },
|
||||||
FontInfo.small)
|
FontInfo.small)
|
||||||
}
|
}
|
||||||
if (downTick) timeline.drawTick(x, -1)
|
if (extraTicks)
|
||||||
|
timeline.drawTick(x, -level)
|
||||||
}
|
}
|
||||||
if (timeline.visibleRange(start, end)) {
|
if (timeline.visibleRange(start, end)) {
|
||||||
if (first == null)
|
if (first == null)
|
||||||
@@ -137,6 +137,15 @@ export class Ticks {
|
|||||||
return null
|
return null
|
||||||
return { start: first, end: last }
|
return { start: first, end: last }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
drawExtra(timeline, range, size) {
|
||||||
|
for (let { start } of this.iterRanges(range)) {
|
||||||
|
if (timeline.visibleDate(start)) {
|
||||||
|
let x = timeline.toX(start)
|
||||||
|
timeline.drawTick(x, -size)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class DecadeTicks extends Ticks {
|
export class DecadeTicks extends Ticks {
|
||||||
@@ -434,15 +443,34 @@ export class TimeTicks {
|
|||||||
visible.push(ticks)
|
visible.push(ticks)
|
||||||
}
|
}
|
||||||
let level = 0
|
let level = 0
|
||||||
|
let ranges = []
|
||||||
for (let ticks of visible) {
|
for (let ticks of visible) {
|
||||||
if (range == null)
|
if (range == null)
|
||||||
return
|
continue
|
||||||
range = ticks.draw(timeline, range, width, height,
|
range = ticks.draw(timeline, range, width, height,
|
||||||
availables.get(ticks),
|
availables.get(ticks),
|
||||||
formats.get(ticks),
|
formats.get(ticks),
|
||||||
nextFormats.get(ticks), level)
|
nextFormats.get(ticks), level)
|
||||||
|
if (range) {
|
||||||
|
ranges.push({ticks, range})
|
||||||
|
}
|
||||||
level += 1
|
level += 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let extraLevel = ranges.length - 1
|
||||||
|
let extraStart = extraLevel
|
||||||
|
for(let {ticks, range} of ranges) {
|
||||||
|
ticks.drawExtra(timeline, range, extraLevel)
|
||||||
|
extraLevel -= 1
|
||||||
|
if (extraLevel <= 0) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
timeline.drawTick(start, Ticks.largeTickSize)
|
||||||
|
timeline.drawTick(start, -extraStart)
|
||||||
|
timeline.drawTick(end, Ticks.largeTickSize)
|
||||||
|
timeline.drawTick(end, -extraStart)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Tooltip</h1>
|
<h1>Tooltip</h1>
|
||||||
|
|||||||
@@ -9,10 +9,10 @@
|
|||||||
<link rel="stylesheet" href="../../css/doctest.css">
|
<link rel="stylesheet" href="../../css/doctest.css">
|
||||||
|
|
||||||
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
<script src="../3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../3rdparty/all.js"></script>
|
<script src="../../dist/iwmlib.3rdparty.js"></script>
|
||||||
|
|
||||||
<script src="../all.js"></script>
|
<script src="../../dist/iwmlib.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../../dist/iwmlib.pixi.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<h1>Volatile</h1>
|
<h1>Volatile</h1>
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Poppable Doctest</title>
|
<title>Poppable Doctest</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="./3rdparty/all.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="page" onload="Doctest.run()">
|
<body id="page" onload="Doctest.run()">
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<title>Popup Doctest</title>
|
<title>Popup Doctest</title>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body id="page" onload="Doctest.run()">
|
<body id="page" onload="Doctest.run()">
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Scatter Doctest</title>
|
<title>Scatter Doctest</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="./3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function drawPolygons() {
|
function drawPolygons() {
|
||||||
debugCanvas.width = main.getBoundingClientRect().width
|
debugCanvas.width = main.getBoundingClientRect().width
|
||||||
|
|||||||
@@ -127,7 +127,9 @@ class Throwable {
|
|||||||
this.lastframe = t
|
this.lastframe = t
|
||||||
if (dt > 0) {
|
if (dt > 0) {
|
||||||
// Avoid division by zero errors later on
|
// 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)
|
this.velocities.push(velocity)
|
||||||
while (this.velocities.length > buffer) {
|
while (this.velocities.length > buffer) {
|
||||||
this.velocities.shift()
|
this.velocities.shift()
|
||||||
@@ -136,7 +138,7 @@ class Throwable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
meanVelocity(milliseconds = 30) {
|
meanVelocity(milliseconds = 30) {
|
||||||
this.addVelocity({ x: 0, y: 0 })
|
this.addVelocity({ x: 0, y: 0, number: 1 })
|
||||||
let sum = { x: 0, y: 0 }
|
let sum = { x: 0, y: 0 }
|
||||||
let count = 0
|
let count = 0
|
||||||
let t = 0
|
let t = 0
|
||||||
@@ -171,11 +173,16 @@ class Throwable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
animateThrow(time) {
|
_throwDeltaTime() {
|
||||||
if (this.velocity != null) {
|
|
||||||
let t = performance.now()
|
let t = performance.now()
|
||||||
let dt = t - this.lastframe
|
let dt = t - this.lastframe
|
||||||
this.lastframe = t
|
this.lastframe = t
|
||||||
|
return dt
|
||||||
|
}
|
||||||
|
|
||||||
|
animateThrow(time) {
|
||||||
|
if (this.velocity != null) {
|
||||||
|
let dt = this._throwDeltaTime()
|
||||||
// console.log("animateThrow", dt)
|
// console.log("animateThrow", dt)
|
||||||
let next = this.nextVelocity(this.velocity)
|
let next = this.nextVelocity(this.velocity)
|
||||||
let prevLength = Points.length(this.velocity)
|
let prevLength = Points.length(this.velocity)
|
||||||
@@ -408,7 +415,9 @@ export class AbstractScatter extends Throwable {
|
|||||||
|
|
||||||
keepOnStage(velocity, collision = 0.5) {
|
keepOnStage(velocity, collision = 0.5) {
|
||||||
let stagePolygon = this.containerPolygon
|
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 polygon = this.polygon
|
||||||
let bounced = this.bouncing()
|
let bounced = this.bouncing()
|
||||||
if (bounced) {
|
if (bounced) {
|
||||||
@@ -1430,7 +1439,7 @@ export class DOMScatter extends AbstractScatter {
|
|||||||
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected))
|
let resizeW = r * Math.cos(Angle.degree2radian(phiCorrected))
|
||||||
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected))
|
let resizeH = -r * Math.sin(Angle.degree2radian(phiCorrected))
|
||||||
|
|
||||||
if (this.element.offsetWidth + resizeW / this.scale > this.width * 0.3 && this.element.offsetHeight + resizeH / this.scale > this.height * 0.3) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
if ((this.element.offsetWidth + resizeW) / this.scale > this.width * 0.5 / this.scale && (this.element.offsetHeight + resizeH) / this.scale > this.height * 0.3 / this.scale) TweenLite.to(this.element, 0, { width: this.element.offsetWidth + resizeW / this.scale, height: this.element.offsetHeight + resizeH / this.scale });
|
||||||
|
|
||||||
this.oldX = e.clientX
|
this.oldX = e.clientX
|
||||||
this.oldY = e.clientY
|
this.oldY = e.clientY
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Styleguide</title>
|
<title>Styleguide</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="./3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<script src="../../lib/3rdparty/all.js"></script>
|
<script src=".././3rdparty/all.js"></script>
|
||||||
<script src="../../lib/bootstrap.js"></script>
|
<script src="../../lib/bootstrap.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="site" oncontextmenu="return false" >
|
<body class="site" oncontextmenu="return false" >
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
<meta name="viewport" content="width=device-width, user-scalable=no" />
|
||||||
<title>Doctests Functional Tests</title>
|
<title>Doctests Functional Tests</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="../lib/3rdparty/all.js"></script>
|
<script src="./3rdparty/all.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
<script src="pixi/all.js"></script>
|
<script src="pixi/all.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run(); loaded()" >
|
<body onload="Doctest.run(); loaded()" >
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 69 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 123 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 124 KiB |
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 62 KiB |
|
Before Width: | Height: | Size: 186 KiB After Width: | Height: | Size: 74 KiB |
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 44 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 187 KiB |
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 100 KiB After Width: | Height: | Size: 41 KiB |
@@ -3,11 +3,11 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>UITest Doctest</title>
|
<title>UITest Doctest</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="./3rdparty/all.js"></script>
|
<script src="../dist/iwmlib.3rdparty.js"></script>
|
||||||
<script src="./all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()" >
|
<body onload="Doctest.run()" >
|
||||||
<h1>
|
<h1>
|
||||||
|
|||||||
@@ -3,10 +3,10 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
<title>Doctests</title>
|
<title>Doctests</title>
|
||||||
<link rel="stylesheet" href="../lib/3rdparty/highlight/styles/default.css">
|
<link rel="stylesheet" href="./3rdparty/highlight/styles/default.css">
|
||||||
<link rel="stylesheet" href="../css/doctest.css">
|
<link rel="stylesheet" href="../css/doctest.css">
|
||||||
<script src="../lib/3rdparty/highlight/highlight.pack.js"></script>
|
<script src="./3rdparty/highlight/highlight.pack.js"></script>
|
||||||
<script src="all.js"></script>
|
<script src="../dist/iwmlib.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="Doctest.run()">
|
<body onload="Doctest.run()">
|
||||||
<main>
|
<main>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "iwmlib",
|
"name": "iwmlib",
|
||||||
"version": "1.0.4",
|
"version": "1.0.10",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -193,6 +193,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz",
|
||||||
"integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw=="
|
"integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw=="
|
||||||
},
|
},
|
||||||
|
"agent-base": {
|
||||||
|
"version": "4.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz",
|
||||||
|
"integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==",
|
||||||
|
"requires": {
|
||||||
|
"es6-promisify": "^5.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"amdefine": {
|
"amdefine": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
|
||||||
@@ -386,6 +394,11 @@
|
|||||||
"integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
|
"integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"async-limiter": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
|
||||||
|
"integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg=="
|
||||||
|
},
|
||||||
"async-settle": {
|
"async-settle": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/async-settle/-/async-settle-1.0.0.tgz",
|
||||||
@@ -421,8 +434,7 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
|
||||||
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
|
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"version": "0.11.2",
|
"version": "0.11.2",
|
||||||
@@ -509,7 +521,6 @@
|
|||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
|
||||||
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@@ -765,8 +776,7 @@
|
|||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"concat-stream": {
|
"concat-stream": {
|
||||||
"version": "1.6.2",
|
"version": "1.6.2",
|
||||||
@@ -839,7 +849,6 @@
|
|||||||
"version": "2.6.9",
|
"version": "2.6.9",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"ms": "2.0.0"
|
"ms": "2.0.0"
|
||||||
}
|
}
|
||||||
@@ -1039,6 +1048,19 @@
|
|||||||
"es6-symbol": "^3.1.1"
|
"es6-symbol": "^3.1.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"es6-promise": {
|
||||||
|
"version": "4.2.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz",
|
||||||
|
"integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q=="
|
||||||
|
},
|
||||||
|
"es6-promisify": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
|
||||||
|
"integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
|
||||||
|
"requires": {
|
||||||
|
"es6-promise": "^4.0.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"es6-symbol": {
|
"es6-symbol": {
|
||||||
"version": "3.1.1",
|
"version": "3.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz",
|
||||||
@@ -1250,6 +1272,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"extract-zip": {
|
||||||
|
"version": "1.6.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz",
|
||||||
|
"integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=",
|
||||||
|
"requires": {
|
||||||
|
"concat-stream": "1.6.2",
|
||||||
|
"debug": "2.6.9",
|
||||||
|
"mkdirp": "0.5.1",
|
||||||
|
"yauzl": "2.4.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"falafel": {
|
"falafel": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/falafel/-/falafel-2.1.0.tgz",
|
||||||
@@ -1280,6 +1313,14 @@
|
|||||||
"time-stamp": "^1.0.0"
|
"time-stamp": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fd-slicer": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz",
|
||||||
|
"integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=",
|
||||||
|
"requires": {
|
||||||
|
"pend": "~1.2.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fill-range": {
|
"fill-range": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
|
||||||
@@ -1388,6 +1429,16 @@
|
|||||||
"map-cache": "^0.2.2"
|
"map-cache": "^0.2.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"fs-extra": {
|
||||||
|
"version": "8.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz",
|
||||||
|
"integrity": "sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A==",
|
||||||
|
"requires": {
|
||||||
|
"graceful-fs": "^4.1.2",
|
||||||
|
"jsonfile": "^4.0.0",
|
||||||
|
"universalify": "^0.1.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"fs-mkdirp-stream": {
|
"fs-mkdirp-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs-mkdirp-stream/-/fs-mkdirp-stream-1.0.0.tgz",
|
||||||
@@ -1401,8 +1452,7 @@
|
|||||||
"fs.realpath": {
|
"fs.realpath": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
|
||||||
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
|
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"fsevents": {
|
"fsevents": {
|
||||||
"version": "1.2.9",
|
"version": "1.2.9",
|
||||||
@@ -1424,8 +1474,7 @@
|
|||||||
"ansi-regex": {
|
"ansi-regex": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"aproba": {
|
"aproba": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
@@ -1446,14 +1495,12 @@
|
|||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@@ -1468,20 +1515,17 @@
|
|||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@@ -1598,8 +1642,7 @@
|
|||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@@ -1611,7 +1654,6 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@@ -1626,7 +1668,6 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@@ -1634,14 +1675,12 @@
|
|||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.3.5",
|
"version": "2.3.5",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.1.2",
|
"safe-buffer": "^5.1.2",
|
||||||
"yallist": "^3.0.0"
|
"yallist": "^3.0.0"
|
||||||
@@ -1660,7 +1699,6 @@
|
|||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "0.0.8"
|
||||||
}
|
}
|
||||||
@@ -1741,8 +1779,7 @@
|
|||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@@ -1754,7 +1791,6 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@@ -1840,8 +1876,7 @@
|
|||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"safer-buffer": {
|
"safer-buffer": {
|
||||||
"version": "2.1.2",
|
"version": "2.1.2",
|
||||||
@@ -1877,7 +1912,6 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
@@ -1897,7 +1931,6 @@
|
|||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"ansi-regex": "^2.0.0"
|
"ansi-regex": "^2.0.0"
|
||||||
}
|
}
|
||||||
@@ -1941,14 +1974,12 @@
|
|||||||
"wrappy": {
|
"wrappy": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"yallist": {
|
"yallist": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"dev": true,
|
"dev": true
|
||||||
"optional": true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -1973,7 +2004,6 @@
|
|||||||
"version": "7.1.4",
|
"version": "7.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz",
|
||||||
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
|
"integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"fs.realpath": "^1.0.0",
|
"fs.realpath": "^1.0.0",
|
||||||
"inflight": "^1.0.4",
|
"inflight": "^1.0.4",
|
||||||
@@ -2454,11 +2484,34 @@
|
|||||||
"integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==",
|
"integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"https-proxy-agent": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==",
|
||||||
|
"requires": {
|
||||||
|
"agent-base": "^4.1.0",
|
||||||
|
"debug": "^3.1.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "3.2.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
|
||||||
|
"integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"inflight": {
|
"inflight": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
|
||||||
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"once": "^1.3.0",
|
"once": "^1.3.0",
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
@@ -2690,9 +2743,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ismobilejs": {
|
"ismobilejs": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-0.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/ismobilejs/-/ismobilejs-0.5.2.tgz",
|
||||||
"integrity": "sha512-QX4STsOcBYqlTjVGuAdP1MiRVxtiUbRHOKH0v7Gn1EvfUVIQnrSdgCM4zB4VCZuIejnb2NUMUx0Bwd3EIG6yyA=="
|
"integrity": "sha512-ta9UdV60xVZk/ZafFtSFslQaE76SvNkcs1r73d2PVR21zVzx9xuYv9tNe4MxA1NN7WoeCc2RjGot3Bz1eHDx3Q=="
|
||||||
},
|
},
|
||||||
"isobject": {
|
"isobject": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
@@ -2908,6 +2961,11 @@
|
|||||||
"to-regex": "^3.0.2"
|
"to-regex": "^3.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mime": {
|
||||||
|
"version": "2.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.3.tgz",
|
||||||
|
"integrity": "sha512-QgrPRJfE+riq5TPZMcHZOtm8c6K/yYrMbKIoRfapfiGLxS8OTeIfRhUGW5LU7MlRa52KOAGCfUNruqLrIBvWZw=="
|
||||||
|
},
|
||||||
"mini-signals": {
|
"mini-signals": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/mini-signals/-/mini-signals-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/mini-signals/-/mini-signals-1.2.0.tgz",
|
||||||
@@ -2917,7 +2975,6 @@
|
|||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@@ -2948,11 +3005,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mkdirp": {
|
||||||
|
"version": "0.5.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
|
||||||
|
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
|
||||||
|
"requires": {
|
||||||
|
"minimist": "0.0.8"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"minimist": {
|
||||||
|
"version": "0.0.8",
|
||||||
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
|
||||||
|
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ms": {
|
"ms": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||||
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=",
|
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"murmurhash-js": {
|
"murmurhash-js": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
@@ -3145,7 +3216,6 @@
|
|||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||||
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@@ -3234,8 +3304,7 @@
|
|||||||
"path-is-absolute": {
|
"path-is-absolute": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
|
||||||
"dev": true
|
|
||||||
},
|
},
|
||||||
"path-parse": {
|
"path-parse": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
@@ -3268,6 +3337,11 @@
|
|||||||
"pinkie-promise": "^2.0.0"
|
"pinkie-promise": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"pend": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
|
||||||
|
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
|
||||||
|
},
|
||||||
"pify": {
|
"pify": {
|
||||||
"version": "2.3.0",
|
"version": "2.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||||
@@ -3387,6 +3461,11 @@
|
|||||||
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
|
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"progress": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA=="
|
||||||
|
},
|
||||||
"propagating-hammerjs": {
|
"propagating-hammerjs": {
|
||||||
"version": "1.4.6",
|
"version": "1.4.6",
|
||||||
"resolved": "https://registry.npmjs.org/propagating-hammerjs/-/propagating-hammerjs-1.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/propagating-hammerjs/-/propagating-hammerjs-1.4.6.tgz",
|
||||||
@@ -3395,6 +3474,11 @@
|
|||||||
"hammerjs": "^2.0.6"
|
"hammerjs": "^2.0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"proxy-from-env": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz",
|
||||||
|
"integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4="
|
||||||
|
},
|
||||||
"pump": {
|
"pump": {
|
||||||
"version": "2.0.1",
|
"version": "2.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz",
|
||||||
@@ -3416,6 +3500,36 @@
|
|||||||
"pump": "^2.0.0"
|
"pump": "^2.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"puppeteer": {
|
||||||
|
"version": "1.17.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.17.0.tgz",
|
||||||
|
"integrity": "sha512-3EXZSximCzxuVKpIHtyec8Wm2dWZn1fc5tQi34qWfiUgubEVYHjUvr0GOJojqf3mifI6oyKnCdrGxaOI+lWReA==",
|
||||||
|
"requires": {
|
||||||
|
"debug": "^4.1.0",
|
||||||
|
"extract-zip": "^1.6.6",
|
||||||
|
"https-proxy-agent": "^2.2.1",
|
||||||
|
"mime": "^2.0.3",
|
||||||
|
"progress": "^2.0.1",
|
||||||
|
"proxy-from-env": "^1.0.0",
|
||||||
|
"rimraf": "^2.6.1",
|
||||||
|
"ws": "^6.1.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"debug": {
|
||||||
|
"version": "4.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
|
||||||
|
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
|
||||||
|
"requires": {
|
||||||
|
"ms": "^2.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ms": {
|
||||||
|
"version": "2.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
|
||||||
|
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"quote-stream": {
|
"quote-stream": {
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-0.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-0.0.0.tgz",
|
||||||
@@ -3679,6 +3793,14 @@
|
|||||||
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
|
"integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"rimraf": {
|
||||||
|
"version": "2.6.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
|
||||||
|
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
|
||||||
|
"requires": {
|
||||||
|
"glob": "^7.1.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"safe-buffer": {
|
"safe-buffer": {
|
||||||
"version": "5.1.2",
|
"version": "5.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||||
@@ -4301,6 +4423,11 @@
|
|||||||
"through2-filter": "^3.0.0"
|
"through2-filter": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"universalify": {
|
||||||
|
"version": "0.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
|
||||||
|
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
|
||||||
|
},
|
||||||
"unset-value": {
|
"unset-value": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
|
||||||
@@ -4482,6 +4609,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
|
||||||
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
|
||||||
},
|
},
|
||||||
|
"ws": {
|
||||||
|
"version": "6.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz",
|
||||||
|
"integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==",
|
||||||
|
"requires": {
|
||||||
|
"async-limiter": "~1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xtend": {
|
"xtend": {
|
||||||
"version": "4.0.1",
|
"version": "4.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
|
||||||
@@ -4522,6 +4657,14 @@
|
|||||||
"requires": {
|
"requires": {
|
||||||
"camelcase": "^3.0.0"
|
"camelcase": "^3.0.0"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"yauzl": {
|
||||||
|
"version": "2.4.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz",
|
||||||
|
"integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=",
|
||||||
|
"requires": {
|
||||||
|
"fd-slicer": "~1.0.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "iwmlib",
|
"name": "iwmlib",
|
||||||
"version": "1.0.4",
|
"version": "1.0.14",
|
||||||
"description": "An Open Source library for multi-touch, WebGL powered applications.",
|
"description": "An Open Source library for multi-touch, WebGL powered applications.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"directories": {
|
"directories": {
|
||||||
"example": "examples"
|
"example": "examples"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "node bin/testrunner.js",
|
||||||
"build": "rollup --config ./rollup.config.js",
|
"build": "rollup --config ./rollup.config.js",
|
||||||
"watch": "rollup --watch --config ./rollup.config.js",
|
"watch": "rollup --watch --config ./rollup.config.js",
|
||||||
"3rdparty": "gulp",
|
"3rdparty": "gulp",
|
||||||
@@ -28,6 +28,7 @@
|
|||||||
"gulp-uglify": "^3.0.2"
|
"gulp-uglify": "^3.0.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"fs-extra": "^8.0.1",
|
||||||
"gsap": "^2.1.3",
|
"gsap": "^2.1.3",
|
||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"optimal-select": "^4.0.1",
|
"optimal-select": "^4.0.1",
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
"pixi-particles": "^4.1.0",
|
"pixi-particles": "^4.1.0",
|
||||||
"pixi-projection": "^0.2.7",
|
"pixi-projection": "^0.2.7",
|
||||||
"pixi.js": "^4.8.7",
|
"pixi.js": "^4.8.7",
|
||||||
"propagating-hammerjs": "^1.4.6"
|
"propagating-hammerjs": "^1.4.6",
|
||||||
|
"puppeteer": "^1.16.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||