Skip to content

Commit

Permalink
Merge pull request #353 from K3D-tools/devel
Browse files Browse the repository at this point in the history
v.2.14.1
  • Loading branch information
artur-trzesiok authored May 25, 2022
2 parents 110234e + 76d1e48 commit e54e724
Show file tree
Hide file tree
Showing 16 changed files with 91 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ language: python
services:
- xvfb
before_install:
- nvm install 12.14
- nvm install 16.15
before_script:
- pip install vtk pixelmatch flask msgpack webdriver_manager selenium scikit-image jupyterlab
- npm install webpack webpack-cli -g
Expand Down
8 changes: 8 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import json
from os.path import dirname
from source.k3d_directives.plot import K3D_Plot
import shutil

here = os.path.dirname(__file__)
docs = dirname(dirname(__file__))
Expand Down Expand Up @@ -210,9 +211,16 @@


def setup(app):
shutil.copy('./../js/dist/standalone.js', './source/_static/standalone.js')
shutil.copy('./../node_modules/requirejs/require.js', './source/_static/require.js')

try:
app.add_stylesheet('style.css')
app.add_javascript('require.js')
app.add_javascript('standalone.js?k3d')
except AttributeError:
app.add_css_file('style.css')
app.add_js_file('require.js')
app.add_js_file('standalone.js?k3d')

app.add_directive('k3d_plot', K3D_Plot)
49 changes: 24 additions & 25 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "k3d",
"version": "2.14.0",
"version": "2.14.1",
"description": "3D visualization library",
"author": "k3d team",
"main": "src/index.js",
Expand All @@ -25,50 +25,49 @@
},
"devDependencies": {
"components-webfontloader": "1.5.2",
"copy-webpack-plugin": "^9.0.0",
"copy-webpack-plugin": "^11.0.0",
"cors": "2.8.5",
"css-loader": "^5.2.5",
"eslint": "^7.2.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.25.2",
"css-loader": "^6.7.1",
"style-loader": "^3.3.1",
"eslint": "^8.16.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-markdown": "^2.2.1",
"express": "^4.17.1",
"grunt": "^1.4.0",
"grunt-contrib-clean": "2.0.0",
"express": "^4.18.1",
"grunt": "^1.5.3",
"grunt-contrib-clean": "2.0.1",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-jshint": "^3.1.1",
"grunt-contrib-jshint": "^3.2.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-curl": "^2.5.1",
"grunt-eslint": "^23.0.0",
"grunt-eslint": "^24.0.0",
"grunt-express-server": "0.5.4",
"grunt-jsdoc": "2.4.1",
"grunt-open": "^0.2.4",
"grunt-webpack": "^4.0.3",
"grunt-webpack": "^5.0.0",
"jshint-stylish": "^2.2.1",
"json-loader": "^0.5.4",
"json-loader": "^0.5.7",
"load-grunt-tasks": "5.1.0",
"time-grunt": "2.0.0",
"webpack": "^5.60.0",
"webpack-cli": "^4.9.1",
"webpack": "^5.72.1",
"webpack-cli": "^4.9.2",
"webpack-combine-loaders": "^2.0.4",
"webpack-node-externals": "^3.0.0",
"webpack-visualizer-plugin2": "^1.0.0"
},
"dependencies": {
"@jupyter-widgets/base": "^4.0.0",
"lil-gui": "^0.16.0",
"es6-promise": "^4.2.8",
"fflate": "^0.7.1",
"@jupyter-widgets/base": "^4.1.0",
"lil-gui": "^0.16.1",
"fflate": "^0.7.3",
"file-saver": "^2.0.5",
"katex": "^0.13.19",
"katex": "^0.15.6",
"lodash": "^4.17.21",
"msgpack-lite": "^0.1.26",
"rasterizehtml": "^1.3.0",
"rasterizehtml": "^1.3.1",
"requirejs": "^2.3.6",
"screenfull": "^5.1.0",
"screenfull": "^6.0.1",
"stats.js": "^0.17.0",
"style-loader": "^2.0.0",
"three": "^0.138.2",
"three-mesh-bvh": "^0.3.7"
"three": "^0.140.2",
"three-mesh-bvh": "^0.5.11"
}
}
2 changes: 1 addition & 1 deletion js/src/core/lib/fullscreen.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const screenfull = require('screenfull');
const screenfull = require('screenfull').default;

function fullscreenGUI(container, gui, currentWindow) {
const obj = {
Expand Down
72 changes: 42 additions & 30 deletions js/src/core/lib/snapshot_inline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,50 @@
}

function loadK3D() {
loadScript('https://unpkg.com/k3d@[VERSION]/dist/standalone.js', function () {
require(['k3d'], function (lib) {
function _base64ToArrayBuffer(base64) {
var binary_string = window.atob(base64);
var len = binary_string.length;
var bytes = new Uint8Array(len);
for (var i = 0; i < len; i++) {
bytes[i] = binary_string.charCodeAt(i);
}
return bytes;
function load(lib) {
function _base64ToArrayBuffer(base64) {
var binary_string = window.atob(base64);
var len = binary_string.length;
var bytes = new Uint8Array(len);
for (var i = 0; i < len; i++) {
bytes[i] = binary_string.charCodeAt(i);
}
return bytes;
}

try {
document.getElementById('canvasTarget_[ID]').style.cssText = [
`height:[HEIGHT]px`,
'position: relative',
].join(';');

K3DInstance = new lib.CreateK3DAndLoadBinarySnapshot(
_base64ToArrayBuffer(data_[ID]),
document.getElementById('canvasTarget_[ID]'),
);

K3DInstance.then(function (K3DInstance) {
[ADDITIONAL]
});
} catch (e) {
console.log(e);
return;
}
});
});
try {
document.getElementById('canvasTarget_[ID]').style.cssText = [
`height:[HEIGHT]px`,
'position: relative',
].join(';');

K3DInstance = new lib.CreateK3DAndLoadBinarySnapshot(
_base64ToArrayBuffer(data_[ID]),
document.getElementById('canvasTarget_[ID]'),
);

K3DInstance.then(function (K3DInstance) {
[ADDITIONAL]
});
} catch (e) {
console.log(e);
return;
}
}

require(['k3d'],
load,
function () {
loadScript('https://unpkg.com/k3d@[VERSION]/dist/standalone.js', function () {
try {
delete require.s.contexts._.registry.k3d;
} catch(err) {
console.log(err);
}

require(['k3d'], load);
});
});
}

if (typeof (require) === 'undefined') {
Expand Down
1 change: 0 additions & 1 deletion js/src/development.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
require('es6-promise');
require('katex/dist/katex.min.css');
require('lil-gui/dist/lil-gui.css');

Expand Down
2 changes: 0 additions & 2 deletions js/src/k3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ const objectsList = {};
const chunkList = {};
const plotsList = [];

require('es6-promise');

function runOnEveryPlot(id, cb) {
plotsList.forEach((plot) => {
if (plot.model.get('object_ids').indexOf(id) !== -1) {
Expand Down
2 changes: 1 addition & 1 deletion js/src/providers/threejs/objects/Voxels.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
create(config, K3D) {
return VoxelsHelper.create(
config,
VoxelsHelper.generateRegularChunks(27, config.voxels.shape, config.voxels.data),
VoxelsHelper.generateRegularChunks(96, config.voxels.shape, config.voxels.data),
[config.voxels.shape[2], config.voxels.shape[1], config.voxels.shape[0]],
K3D,
);
Expand Down
2 changes: 2 additions & 0 deletions k3d/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,7 @@ def plot(
camera_pan_speed=0.3,
camera_damping_factor=0.0,
fps=25.0,
fps_meter=False,
name=None,
custom_data=None
):
Expand Down Expand Up @@ -1932,5 +1933,6 @@ def plot(
camera_pan_speed=camera_pan_speed,
auto_rendering=auto_rendering,
fps=fps,
fps_meter=fps_meter,
custom_data=custom_data
)
Binary file modified k3d/test/references/voxels_box.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified k3d/test/references/voxels_outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified k3d/test/references/voxels_outline_clipping_plane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified k3d/test/references/voxels_outline_dynamic_outlines_color.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified k3d/test/references/voxels_outline_opacity.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified k3d/test/references/voxels_wireframe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "k3d",
"version": "2.14.0",
"version": "2.14.1",
"description": "3D visualization library",
"keywords": [
"jupyter",
Expand Down Expand Up @@ -40,25 +40,24 @@
},
"dependencies": {
"@jupyter-widgets/base": "^4.1.0",
"es6-promise": "^4.2.8",
"fflate": "^0.7.1",
"fflate": "^0.7.3",
"file-saver": "^2.0.5",
"katex": "^0.13.19",
"lil-gui": "^0.16.0",
"katex": "^0.15.6",
"lil-gui": "^0.16.1",
"lodash": "^4.17.21",
"msgpack-lite": "^0.1.26",
"rasterizehtml": "^1.3.0",
"rasterizehtml": "^1.3.1",
"requirejs": "^2.3.6",
"screenfull": "^5.1.0",
"screenfull": "^6.0.1",
"stats.js": "^0.17.0",
"style-loader": "^2.0.0",
"three": "^0.138.2",
"three-mesh-bvh": "^0.3.7"
"three": "^0.140.2",
"three-mesh-bvh": "^0.5.11"
},
"devDependencies": {
"@jupyterlab/builder": "^3.4.1",
"prettier": "^2.4.1",
"rimraf": "^3.0.2"
"@jupyterlab/builder": "^3.4.2",
"prettier": "^2.6.2",
"rimraf": "^3.0.2",
"style-loader": "^3.3.1"
},
"jupyterlab": {
"extension": true,
Expand Down

0 comments on commit e54e724

Please sign in to comment.