Skip to content

Commit 2caa6bd

Browse files
authored
Merge pull request #88 from jupytercalpoly/clean
removed unused/redundant code
2 parents e8d62a5 + 4d82204 commit 2caa6bd

17 files changed

+293
-650
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ module.exports = {
33
'eslint:recommended',
44
'plugin:@typescript-eslint/eslint-recommended',
55
'plugin:@typescript-eslint/recommended',
6-
'plugin:prettier/recommended'
6+
'plugin:prettier/recommended',
7+
'plugin:react/recommended'
78
],
89
parser: '@typescript-eslint/parser',
910
parserOptions: {

census.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3071,7 +3071,7 @@
30713071
"name": "python",
30723072
"nbconvert_exporter": "python",
30733073
"pygments_lexer": "ipython3",
3074-
"version": "3.8.3"
3074+
"version": "3.8.5"
30753075
},
30763076
"presto": {
30773077
"id": "1c9191a6-2e25-4bb0-90f0-68fe8ecbe7f5"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@lumino/datastore": "^0.10.3",
5353
"@lumino/dragdrop": "^1.6.2",
5454
"@lumino/widgets": "^1.13.2",
55+
"eslint-plugin-react": "^7.21.1",
5556
"husky": "^4.2.5",
5657
"lint-staged": "^10.2.11"
5758
},

src/button.ts

Lines changed: 0 additions & 69 deletions
This file was deleted.

src/custom_layout.ts

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import { DocumentRegistry } from '@jupyterlab/docregistry';
2020

2121
import { IChangedArgs } from '@jupyterlab/coreutils';
2222

23-
import { mround } from './utils';
24-
2523
const CANVAS_CLASS = 'pr-Canvas';
2624

2725
const TILED_LAYOUT_CLASS = 'pr-TiledLayout';
@@ -290,10 +288,10 @@ export class DashboardLayout extends Layout {
290288

291289
// Snap to grid if in grid mode.
292290
if (this._mode === 'grid') {
293-
left = mround(left, this._gridSize);
294-
top = mround(top, this._gridSize);
295-
width = Math.max(mround(width, this._gridSize), this._gridSize);
296-
height = Math.max(mround(height, this._gridSize), this._gridSize);
291+
left = Private.mround(left, this._gridSize);
292+
top = Private.mround(top, this._gridSize);
293+
width = Math.max(Private.mround(width, this._gridSize), this._gridSize);
294+
height = Math.max(Private.mround(height, this._gridSize), this._gridSize);
297295
// Change width/height now to force grid changes if they're small.
298296
item.update(0, 0, 0, 0);
299297
}
@@ -686,10 +684,10 @@ export class DashboardLayout extends Layout {
686684
let { left, top, width, height } = pos;
687685

688686
if (this.mode === 'grid') {
689-
width = Math.max(mround(width, this._gridSize), this._gridSize);
690-
height = Math.max(mround(height, this._gridSize), this._gridSize);
691-
left = mround(left, this._gridSize);
692-
top = mround(top, this._gridSize);
687+
width = Math.max(Private.mround(width, this._gridSize), this._gridSize);
688+
height = Math.max(Private.mround(height, this._gridSize), this._gridSize);
689+
left = Private.mround(left, this._gridSize);
690+
top = Private.mround(top, this._gridSize);
693691
}
694692

695693
context.strokeRect(left, top, width, height);
@@ -849,3 +847,15 @@ export interface IDashboardChange {
849847

850848
ignore?: boolean;
851849
}
850+
851+
/**
852+
* A namespace for private functionality
853+
*/
854+
namespace Private {
855+
/**
856+
* Rounds num to the nearest integer multiple of roundTo.
857+
*/
858+
export function mround(num: number, roundTo: number): number {
859+
return roundTo * Math.round(num / roundTo);
860+
}
861+
}

src/dashboard.tsx

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,3 +566,32 @@ export namespace DashboardDocumentFactory {
566566
outputTracker: WidgetTracker<DashboardWidget>;
567567
}
568568
}
569+
570+
/**
571+
* CURRENTLY UNUSED
572+
*
573+
* Opens a visual HTMLElement in fullscreen.
574+
*
575+
* @param node- the element to open in fullscreen.
576+
*/
577+
export function openfullscreen(node: HTMLElement): void {
578+
// Trigger fullscreen
579+
const docElmWithBrowsersFullScreenFunctions = node as HTMLElement & {
580+
mozRequestFullScreen(): Promise<void>;
581+
webkitRequestFullscreen(): Promise<void>;
582+
msRequestFullscreen(): Promise<void>;
583+
};
584+
585+
if (docElmWithBrowsersFullScreenFunctions.requestFullscreen) {
586+
docElmWithBrowsersFullScreenFunctions.requestFullscreen();
587+
} else if (docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen) {
588+
/* Firefox */
589+
docElmWithBrowsersFullScreenFunctions.mozRequestFullScreen();
590+
} else if (docElmWithBrowsersFullScreenFunctions.webkitRequestFullscreen) {
591+
/* Chrome, Safari and Opera */
592+
docElmWithBrowsersFullScreenFunctions.webkitRequestFullscreen();
593+
} else if (docElmWithBrowsersFullScreenFunctions.msRequestFullscreen) {
594+
/* IE/Edge */
595+
docElmWithBrowsersFullScreenFunctions.msRequestFullscreen();
596+
}
597+
}

src/dbUtils.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/dialog.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/fsutils.ts

Lines changed: 0 additions & 90 deletions
This file was deleted.

src/fullscreen.ts

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)