From 7b6a0295152a215b47385e8149626c6832eb2704 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Wed, 23 Oct 2024 14:30:40 -0400 Subject: [PATCH] Exclude few files and apply pre-commit throughout (#412) * Remove requirement for python 3.9 to be used in pre-commit AFAIK this is entirely not needed and in general just complicates use of pre-commit on systems which no longer (for years) have 3.9 readily available * Exclude .map and .svg files from pre-commit consideration * [DATALAD RUNCMD] Run pre-commit run --all (Closes #411) === Do not change lines below === { "chain": [], "cmd": "pre-commit run --all || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- .pre-commit-config.yaml | 1 + neuvue_project/.ebextensions/django.config | 16 +- neuvue_project/.ebextensions/https.config | 2 +- neuvue_project/.ebextensions/packages.config | 2 +- neuvue_project/.platform/nginx.config | 2 +- .../.platform/nginx/conf.d/proxy.conf | 2 +- neuvue_project/dashboard/views.py | 28 ++- neuvue_project/neuvue/settings.py | 2 +- neuvue_project/requirements.txt | 2 +- neuvue_project/requirements.txt.general | 2 +- neuvue_project/requirements.txt.old | 2 +- neuvue_project/templates/404.html | 2 +- neuvue_project/templates/about.html | 26 +-- .../dashboard-namespace-view.html | 10 +- .../admin_dashboard/dashboard-user-view.html | 18 +- .../templates/admin_dashboard/dashboard.html | 15 +- neuvue_project/templates/base.html | 4 +- neuvue_project/templates/getting-started.html | 4 +- neuvue_project/templates/index.html | 2 +- neuvue_project/templates/inspect.html | 54 +++--- neuvue_project/templates/lineage.html | 26 +-- .../confirm_selected_segments_modal.html | 4 +- .../modals/distribute_task_modal.html | 10 +- .../templates/modals/flag_modal.html | 4 +- .../templates/modals/remove_task_modal.html | 2 +- .../templates/modals/timeout_modal.html | 2 +- neuvue_project/templates/nuclei.html | 18 +- neuvue_project/templates/preferences.html | 136 +++++++-------- neuvue_project/templates/report.html | 37 ++-- .../reusable_components/confirm_modal.html | 6 +- .../reusable_components/instructions.html | 8 +- .../reusable_components/metrics_card.html | 1 - .../socialaccount/authentication_error.html | 4 +- neuvue_project/templates/synapse.html | 16 +- neuvue_project/templates/tasks.html | 38 ++--- neuvue_project/templates/token.html | 6 +- neuvue_project/templates/user-namespace.html | 27 ++- neuvue_project/templates/workspace.html | 142 ++++++++-------- neuvue_project/workspace/admin.py | 2 +- .../0017_namespace_decrement_priority.py | 13 +- .../migrations/0018_namespace_ng_host.py | 16 +- .../migrations/0019_auto_20230328_0926.py | 42 ++++- ...orcedchoicebutton_button_color_and_more.py | 18 +- .../0021_alter_namespace_ng_host.py | 19 ++- neuvue_project/workspace/models.py | 16 +- neuvue_project/workspace/neuroglancer.py | 7 +- .../workspace/static/css/dashboard.css | 2 +- neuvue_project/workspace/static/css/tasks.css | 14 +- .../workspace/static/css/workspace.css | 32 ++-- .../workspace/static/favicon/site.webmanifest | 2 +- .../workspace/static/getting_started.md | 76 ++++----- neuvue_project/workspace/static/js/utils.js | 12 +- .../workspace/static/ts/wrapper/.gitignore | 2 +- .../workspace/static/ts/wrapper/README.md | 2 +- .../ts/wrapper/config/webpack.config.js | 4 +- .../workspace/static/ts/wrapper/package.json | 2 +- .../workspace/static/ts/wrapper/src/main.ts | 6 +- neuvue_project/workspace/static/updates.json | 2 +- .../workspace/async_computation.bundle.js | 2 +- .../workspace/static/workspace/bossauth.html | 2 +- .../static/workspace/chunk_worker.bundle.js | 8 +- .../static/workspace/draco.bundle.js | 2 +- .../workspace/static/workspace/index.html | 2 +- .../workspace/static/workspace/main.bundle.js | 160 +++++++++--------- .../static/workspace/tfjs-library.bundle.js | 18 +- neuvue_project/workspace/views/task.py | 2 +- neuvue_project/workspace/views/tools.py | 14 +- neuvue_project/workspace/views/workspace.py | 23 ++- requirements-dev.txt | 2 +- 69 files changed, 644 insertions(+), 563 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 5da80d02..8f8fbe22 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ +exclude: \.(map|svg)$ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v2.3.0 diff --git a/neuvue_project/.ebextensions/django.config b/neuvue_project/.ebextensions/django.config index 5ad2d40a..77e06b52 100644 --- a/neuvue_project/.ebextensions/django.config +++ b/neuvue_project/.ebextensions/django.config @@ -1,17 +1,17 @@ -option_settings: - aws:elasticbeanstalk:application:environment: - DJANGO_SETTINGS_MODULE: "neuvue.settings" +option_settings: + aws:elasticbeanstalk:application:environment: + DJANGO_SETTINGS_MODULE: "neuvue.settings" PYTHONPATH: "/var/app/current:$PYTHONPATH" - aws:elasticbeanstalk:container:python: - WSGIPath: neuvue.wsgi:application - NumProcesses: 3 + aws:elasticbeanstalk:container:python: + WSGIPath: neuvue.wsgi:application + NumProcesses: 3 NumThreads: 20 aws:elasticbeanstalk:environment:proxy:staticfiles: /static: static - + container_commands: 01_collectstatic: command: "source /var/app/venv/*/bin/activate && python3 manage.py collectstatic --noinput" 02_migrate: command: "source /var/app/venv/*/bin/activate && python3 manage.py migrate" - leader_only: true \ No newline at end of file + leader_only: true diff --git a/neuvue_project/.ebextensions/https.config b/neuvue_project/.ebextensions/https.config index e20f0750..aba04341 100644 --- a/neuvue_project/.ebextensions/https.config +++ b/neuvue_project/.ebextensions/https.config @@ -18,4 +18,4 @@ Resources: StatusCode: HTTP_301 Type: redirect Port: 80 - Protocol: HTTP \ No newline at end of file + Protocol: HTTP diff --git a/neuvue_project/.ebextensions/packages.config b/neuvue_project/.ebextensions/packages.config index 8695282a..5f9fb413 100644 --- a/neuvue_project/.ebextensions/packages.config +++ b/neuvue_project/.ebextensions/packages.config @@ -2,4 +2,4 @@ packages: yum: python3-devel: [] mariadb105-devel.x86_64: [] - graphviz: [] \ No newline at end of file + graphviz: [] diff --git a/neuvue_project/.platform/nginx.config b/neuvue_project/.platform/nginx.config index 69c58ca5..fc23179a 100644 --- a/neuvue_project/.platform/nginx.config +++ b/neuvue_project/.platform/nginx.config @@ -1,3 +1,3 @@ container_commands: 01_reload_nginx: - command: "service nginx reload" \ No newline at end of file + command: "service nginx reload" diff --git a/neuvue_project/.platform/nginx/conf.d/proxy.conf b/neuvue_project/.platform/nginx/conf.d/proxy.conf index f6780897..53508026 100644 --- a/neuvue_project/.platform/nginx/conf.d/proxy.conf +++ b/neuvue_project/.platform/nginx/conf.d/proxy.conf @@ -4,4 +4,4 @@ client_body_timeout 300; send_timeout 300; proxy_connect_timeout 300; proxy_read_timeout 300; -proxy_send_timeout 300; \ No newline at end of file +proxy_send_timeout 300; diff --git a/neuvue_project/dashboard/views.py b/neuvue_project/dashboard/views.py index ca0630b3..e81b992e 100644 --- a/neuvue_project/dashboard/views.py +++ b/neuvue_project/dashboard/views.py @@ -325,10 +325,14 @@ def post(self, request, *args, **kwargs): sieve=sieve, select=["assignee", "status", "duration", "metadata", "closed", "opened"], ) - task_df['n_operation_ids'] = task_df['metadata'].apply(lambda x: len(x.get('operation_ids')) if isinstance(x.get('operation_ids'), list) else 0) - task_has_edits = True if any(task_df['n_operation_ids'].to_list()) else False + task_df["n_operation_ids"] = task_df["metadata"].apply( + lambda x: len(x.get("operation_ids")) + if isinstance(x.get("operation_ids"), list) + else 0 + ) + task_has_edits = True if any(task_df["n_operation_ids"].to_list()) else False - if bool((namespace in decision_namespaces) & (len(task_df)>0)): + if bool((namespace in decision_namespaces) & (len(task_df) > 0)): import plotly.express as px from plotly.subplots import make_subplots @@ -343,14 +347,20 @@ def post(self, request, *args, **kwargs): horizontal_spacing=0.02, ) - namespace_submission_method = Namespaces.objects.get(display_name=display_name).submission_method - decision_types = ForcedChoiceButton.objects.filter(set_name=namespace_submission_method).values_list('display_name','submission_value') - + namespace_submission_method = Namespaces.objects.get( + display_name=display_name + ).submission_method + decision_types = ForcedChoiceButton.objects.filter( + set_name=namespace_submission_method + ).values_list("display_name", "submission_value") + color_count = 0 for namespace_display_name, submission_value in decision_types: decision_counts = {} for assignee in users: - decision_counts[assignee] = len(task_df[task_df["decision"] == submission_value]) + decision_counts[assignee] = len( + task_df[task_df["decision"] == submission_value] + ) x = list(decision_counts.keys()) y = list(decision_counts.values()) @@ -388,7 +398,7 @@ def post(self, request, *args, **kwargs): "Username", "Total Duration (h)", "Avg Closed Duration (m)", - "Avg Duration (m)" + "Avg Duration (m)", ] if task_has_edits: columns.extend(["Average Edits", "Total Edits"]) @@ -453,7 +463,7 @@ def post(self, request, *args, **kwargs): "fig_time": fig_time.to_html(), } - if bool((namespace in decision_namespaces) & (len(task_df)>0)): + if bool((namespace in decision_namespaces) & (len(task_df) > 0)): context["fig_decision"] = fig_decision.to_html() return render(request, "report.html", context) diff --git a/neuvue_project/neuvue/settings.py b/neuvue_project/neuvue/settings.py index 1f3c2828..949e73f8 100644 --- a/neuvue_project/neuvue/settings.py +++ b/neuvue_project/neuvue/settings.py @@ -204,7 +204,7 @@ LOGIN_URL = "index" LOGIN_REDIRECT_URL = "/tasks" LOGOUT_REDIRECT_URL = "/" -SOCIALACCOUNT_LOGIN_ON_GET = True +SOCIALACCOUNT_LOGIN_ON_GET = True # Needed for NeuroGlancer Popups SECURE_CROSS_ORIGIN_OPENER_POLICY = None diff --git a/neuvue_project/requirements.txt b/neuvue_project/requirements.txt index 46e6bdb7..d8486d3c 100644 --- a/neuvue_project/requirements.txt +++ b/neuvue_project/requirements.txt @@ -98,4 +98,4 @@ urllib3==1.26.18 wcwidth==0.1.9 webcolors==1.13 zipp==3.18.1 -./deps/neuvue-client +./deps/neuvue-client diff --git a/neuvue_project/requirements.txt.general b/neuvue_project/requirements.txt.general index 1b4462b0..66c007a9 100644 --- a/neuvue_project/requirements.txt.general +++ b/neuvue_project/requirements.txt.general @@ -19,4 +19,4 @@ pandas Pillow plotly requests -./deps/neuvue-client \ No newline at end of file +./deps/neuvue-client diff --git a/neuvue_project/requirements.txt.old b/neuvue_project/requirements.txt.old index cf66e575..72c5f84b 100644 --- a/neuvue_project/requirements.txt.old +++ b/neuvue_project/requirements.txt.old @@ -79,4 +79,4 @@ typing-extensions==3.10.0.2 urllib3==1.26.7 wcwidth==0.1.9 websocket-client==0.59.0 -./deps/neuvue-client \ No newline at end of file +./deps/neuvue-client diff --git a/neuvue_project/templates/404.html b/neuvue_project/templates/404.html index 3d39a1a7..f9df3dad 100644 --- a/neuvue_project/templates/404.html +++ b/neuvue_project/templates/404.html @@ -163,4 +163,4 @@ canvas { outline: none; border: none; } -{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/neuvue_project/templates/about.html b/neuvue_project/templates/about.html index dfda2921..0e8fa7d1 100644 --- a/neuvue_project/templates/about.html +++ b/neuvue_project/templates/about.html @@ -9,7 +9,7 @@

About Us

- We are a team of research scientists and engineers from the Johns Hopkins Applied Physics + We are a team of research scientists and engineers from the Johns Hopkins Applied Physics Laboratory that developed NeuVue with the help of a friendly axonolotl!

@@ -25,21 +25,21 @@

About Us

- NeuVue is a software platform created for large-scale proofreading of machine segmentation and neural - circuit reconstruction in high-resolution electron microscopy connectomics datasets. NeuVue provides an - intuitive interface for proofreaders to collaboratively view, annotate, and edit segmentation and + NeuVue is a software platform created for large-scale proofreading of machine segmentation and neural + circuit reconstruction in high-resolution electron microscopy connectomics datasets. NeuVue provides an + intuitive interface for proofreaders to collaboratively view, annotate, and edit segmentation and connectivity data. - - NeuVue has everything you need for a high-throughput proofreading workflow! Analytical dashboards, data - visualization tools, and simple API enables stakeholders real-time access to proofreading progress at an - individual proofreader level as well as global reconstruction quality insights. NeuVue is intentionally - agnostic to the underlying data management backend and can be easily deployed in an AWS environment. - Proofreaders can work with powerful streamlined tools for splitting and merging connectivity data in - dense nano-scale reconstruction better than ever before. + + NeuVue has everything you need for a high-throughput proofreading workflow! Analytical dashboards, data + visualization tools, and simple API enables stakeholders real-time access to proofreading progress at an + individual proofreader level as well as global reconstruction quality insights. NeuVue is intentionally + agnostic to the underlying data management backend and can be easily deployed in an AWS environment. + Proofreaders can work with powerful streamlined tools for splitting and merging connectivity data in + dense nano-scale reconstruction better than ever before.

- This research was enabled by the IARPA Machine Intelligence from Cortical Networks (MICrONS) program. + This research was enabled by the IARPA Machine Intelligence from Cortical Networks (MICrONS) program. Learn more about MICrONS.

@@ -88,4 +88,4 @@

Contact Us

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/neuvue_project/templates/admin_dashboard/dashboard-namespace-view.html b/neuvue_project/templates/admin_dashboard/dashboard-namespace-view.html index d5b7811e..e8bf6225 100644 --- a/neuvue_project/templates/admin_dashboard/dashboard-namespace-view.html +++ b/neuvue_project/templates/admin_dashboard/dashboard-namespace-view.html @@ -40,7 +40,7 @@

{% csrf_token %} - + @@ -64,13 +64,13 @@

- +



-
+
- + {% endif %} @@ -130,7 +130,7 @@

// Perform download $('#summary-table').table2csv('download', {'filename': filename}); - }); + }); // button is clicked if ("{{group}}" === "unassigned") { const distributeButton = document.getElementById("distribute-button"); diff --git a/neuvue_project/templates/admin_dashboard/dashboard-user-view.html b/neuvue_project/templates/admin_dashboard/dashboard-user-view.html index 189f6b1b..17c057d4 100644 --- a/neuvue_project/templates/admin_dashboard/dashboard-user-view.html +++ b/neuvue_project/templates/admin_dashboard/dashboard-user-view.html @@ -119,13 +119,13 @@

{% if taskrow.tags %} - {% else %} @@ -142,7 +142,7 @@

-
+
@@ -213,13 +213,13 @@

$('#summary-table input[name=selected_tasks]').each(function(){ if ($(this).is(':checkbox') && !$(this).is(":checked")) { $(this).prop( "checked", true ); - } + } }) } else { $('#summary-table input[name=selected_tasks]').each(function(ele){ if ($(this).is(':checkbox') && $(this).is(":checked")) { $(this).prop( "checked", false ); - } + } }) } }); @@ -239,7 +239,7 @@

// Otherwise, download only the tasks that were selected } else { let filteredTable = $('#summary-table').clone()[0] // make a copy of the visible table to edit and export - filteredTable.id = 'userSelectedTable'; + filteredTable.id = 'userSelectedTable'; const selectedRows = $( '#summary-table' ).find( 'tbody' ) // select table body and .find( 'tr' ) // select all rows that has .has( 'input[type=checkbox]:checked' ); // checked checkbox element diff --git a/neuvue_project/templates/admin_dashboard/dashboard.html b/neuvue_project/templates/admin_dashboard/dashboard.html index 1560996f..192fb58c 100644 --- a/neuvue_project/templates/admin_dashboard/dashboard.html +++ b/neuvue_project/templates/admin_dashboard/dashboard.html @@ -37,7 +37,7 @@

Admin Dashboard

- +
+
- + {% if error %} {{error}} {% endif %} - +
@@ -70,17 +70,17 @@

Admin Dashboard

{% for user_opt in all_users %} {% endfor %} - +
- + {% if error %} {{error}} {% endif %} - +
@@ -106,4 +106,3 @@

Admin Dashboard

{% endblock %} - diff --git a/neuvue_project/templates/base.html b/neuvue_project/templates/base.html index e1601262..b9882a61 100644 --- a/neuvue_project/templates/base.html +++ b/neuvue_project/templates/base.html @@ -14,7 +14,7 @@ - + @@ -50,7 +50,7 @@ {% endif%} - + {% if request.user|in_group:"AuthorizedUsers"%}
{{taskrow.closed}} {{taskrow.duration}} - + - {{ taskrow.tags.0 }} + {{ taskrow.tags.0 }}
- {% for column in table_columns %} + {% for column in table_columns %} {% endfor %} @@ -177,7 +177,7 @@

Generate Task Report

{% endfor %} -
{{column}}
+ @@ -200,9 +200,8 @@

Generate Task Report

const filename = '{{namespace}}' + '_' + '{{group}}' + '_' + '{{start_field}}' + '_by_' + '{{start_date}}'+ '_and_' + '{{end_field}}' + '_by_' + '{{end_date}}' + Date.now() + '.csv'; // Perform download $('#summary-table').table2csv('download', {'filename': filename}); - }); + }); {% endif %} {% endblock %} - diff --git a/neuvue_project/templates/reusable_components/confirm_modal.html b/neuvue_project/templates/reusable_components/confirm_modal.html index ca96ba83..22a01fc5 100644 --- a/neuvue_project/templates/reusable_components/confirm_modal.html +++ b/neuvue_project/templates/reusable_components/confirm_modal.html @@ -47,10 +47,10 @@ confirmModalBody.innerHTML += make_list_of_checked_elements(); $("#userModal").modal("toggle"); $("#{{modal_id}}").modal("toggle"); - } + } else if (input.value == "") { input.style.backgroundColor = "indianred"; - } + } else { const confirmModalBody = document.getElementById("{{confirm_text_id}}"); confirmModalBody.innerHTML = `Update the {{column}} for these tasks to ${input.value} ?`; @@ -60,4 +60,4 @@ } }); - \ No newline at end of file + diff --git a/neuvue_project/templates/reusable_components/instructions.html b/neuvue_project/templates/reusable_components/instructions.html index 8fe6ccb5..349c69f1 100644 --- a/neuvue_project/templates/reusable_components/instructions.html +++ b/neuvue_project/templates/reusable_components/instructions.html @@ -4,8 +4,8 @@
{{ instructions.prompt | safe | linebreaksbr }}
- - {% if instructions.media %} + + {% if instructions.media %}
@@ -16,7 +16,7 @@ \ No newline at end of file + diff --git a/neuvue_project/templates/reusable_components/metrics_card.html b/neuvue_project/templates/reusable_components/metrics_card.html index 653ccb49..799c671f 100644 --- a/neuvue_project/templates/reusable_components/metrics_card.html +++ b/neuvue_project/templates/reusable_components/metrics_card.html @@ -12,4 +12,3 @@
- diff --git a/neuvue_project/templates/socialaccount/authentication_error.html b/neuvue_project/templates/socialaccount/authentication_error.html index 2aad0532..d1b76da0 100644 --- a/neuvue_project/templates/socialaccount/authentication_error.html +++ b/neuvue_project/templates/socialaccount/authentication_error.html @@ -1,8 +1,8 @@ {% extends "base.html" %} {% load socialaccount %} {% block content %} -
+

Error

Code: {{ auth_error.code }}, Error: {{ auth_error.exception }}

-{% endblock %} \ No newline at end of file +{% endblock %} diff --git a/neuvue_project/templates/synapse.html b/neuvue_project/templates/synapse.html index cad5a975..f9fc7a2b 100644 --- a/neuvue_project/templates/synapse.html +++ b/neuvue_project/templates/synapse.html @@ -51,10 +51,10 @@

Synapse Viewer

- +
@@ -98,8 +98,8 @@

Synapse Viewer

-
-
+
+


@@ -109,7 +109,7 @@

Synapse Viewer

-
+
{{display_name}}
- Task ID
+ Task ID
{{task_id}}
Segmentation ID
{{seg_id}}
- PCG Endpoint
+ PCG Endpoint
{{pcg_url}}
{% if was_skipped %} - Skipped
+ Skipped
{{was_skipped}}
{% endif %} - Number of Edits
+ Number of Edits
{{num_edits}}
- Tasks Completed This Session
+ Tasks Completed This Session
{{session_task_count}}
- Neuroglancer Link
+ Neuroglancer Link

- +
- +




-
+
@@ -81,7 +81,7 @@
- - {% endfor %} - - + + {% if ng_url %} @@ -126,15 +126,15 @@
-
+
+ f
@@ -144,32 +144,32 @@
{% endif %} - + {% if skipable %}
-
+
+ k
@@ -179,12 +179,12 @@ {% if submit_task_button %}
-
- +
- -
+
+ e
@@ -229,12 +229,12 @@
- Tasks Complete
{{display_name}} + Tasks Complete
{{display_name}}
-

- \ No newline at end of file + diff --git a/neuvue_project/workspace/static/workspace/chunk_worker.bundle.js b/neuvue_project/workspace/static/workspace/chunk_worker.bundle.js index 4991fa70..4c7c1221 100644 --- a/neuvue_project/workspace/static/workspace/chunk_worker.bundle.js +++ b/neuvue_project/workspace/static/workspace/chunk_worker.bundle.js @@ -21410,7 +21410,7 @@ function decodeBatchMeshResponse(response, callback) { let length = response.byteLength; let index = 0; const dataView = new DataView(response); - const headerSize = + const headerSize = /*object id*/ 8 + /*fragment key length*/ 8 + /*num vertices*/ 8 + /*num triangles*/ 8; while (index < length) { if (index + headerSize > length) { @@ -21702,7 +21702,7 @@ function decodeSkeletonChunk(chunk, response) { if (numEdgesHigh !== 0) { throw new Error(`The number of edges should not exceed 2^32-1.`); } - Object(neuroglancer_skeleton_backend__WEBPACK_IMPORTED_MODULE_8__["decodeSkeletonVertexPositionsAndIndices"])(chunk, response, neuroglancer_util_endian__WEBPACK_IMPORTED_MODULE_13__["Endianness"].LITTLE, /*vertexByteOffset=*/ 16, numVertices, + Object(neuroglancer_skeleton_backend__WEBPACK_IMPORTED_MODULE_8__["decodeSkeletonVertexPositionsAndIndices"])(chunk, response, neuroglancer_util_endian__WEBPACK_IMPORTED_MODULE_13__["Endianness"].LITTLE, /*vertexByteOffset=*/ 16, numVertices, /*indexByteOffset=*/ undefined, /*numEdges=*/ numEdges); } let BrainmapsSkeletonSource = class BrainmapsSkeletonSource extends (BrainmapsSource(neuroglancer_skeleton_backend__WEBPACK_IMPORTED_MODULE_8__["SkeletonSource"], neuroglancer_datasource_brainmaps_base__WEBPACK_IMPORTED_MODULE_5__["SkeletonSourceParameters"])) { @@ -27715,7 +27715,7 @@ function decodeSkeletonChunk(chunk, response, vertexAttributes) { let numEdges = dv.getUint32(4, true); const vertexPositionsStartOffset = 8; let curOffset = 8 + numVertices * 4 * 3; - Object(neuroglancer_skeleton_backend__WEBPACK_IMPORTED_MODULE_0__["decodeSkeletonVertexPositionsAndIndices"])(chunk, response, neuroglancer_util_endian__WEBPACK_IMPORTED_MODULE_2__["Endianness"].LITTLE, /*vertexByteOffset=*/ vertexPositionsStartOffset, numVertices, + Object(neuroglancer_skeleton_backend__WEBPACK_IMPORTED_MODULE_0__["decodeSkeletonVertexPositionsAndIndices"])(chunk, response, neuroglancer_util_endian__WEBPACK_IMPORTED_MODULE_2__["Endianness"].LITTLE, /*vertexByteOffset=*/ vertexPositionsStartOffset, numVertices, /*indexByteOffset=*/ curOffset, /*numEdges=*/ numEdges); curOffset += numEdges * 4 * 2; let attributes = []; @@ -35103,4 +35103,4 @@ module.exports = __webpack_require__(/*! neuroglancer/datasource/csv/backend */" /***/ }) /******/ }); -//# sourceMappingURL=chunk_worker.bundle.js.map \ No newline at end of file +//# sourceMappingURL=chunk_worker.bundle.js.map diff --git a/neuvue_project/workspace/static/workspace/draco.bundle.js b/neuvue_project/workspace/static/workspace/draco.bundle.js index 49d905f7..e65d3a81 100644 --- a/neuvue_project/workspace/static/workspace/draco.bundle.js +++ b/neuvue_project/workspace/static/workspace/draco.bundle.js @@ -157,4 +157,4 @@ function decodeDracoPartitioned(buffer, vertexQuantizationBits, partition) { /***/ }) }); -//# sourceMappingURL=draco.bundle.js.map \ No newline at end of file +//# sourceMappingURL=draco.bundle.js.map diff --git a/neuvue_project/workspace/static/workspace/index.html b/neuvue_project/workspace/static/workspace/index.html index 2db2ba03..cd95cc2e 100644 --- a/neuvue_project/workspace/static/workspace/index.html +++ b/neuvue_project/workspace/static/workspace/index.html @@ -49,4 +49,4 @@
- \ No newline at end of file + diff --git a/neuvue_project/workspace/static/workspace/main.bundle.js b/neuvue_project/workspace/static/workspace/main.bundle.js index 55a33ac7..99315a35 100644 --- a/neuvue_project/workspace/static/workspace/main.bundle.js +++ b/neuvue_project/workspace/static/workspace/main.bundle.js @@ -15400,10 +15400,10 @@ module.exports['DIFF_EQUAL'] = DIFF_EQUAL; self.selectedDates.length > 0 || self.config.noCalendar; var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); /* TODO: investigate this further - + Currently, there is weird positioning behavior in safari causing pages to scroll up. https://github.com/chmln/flatpickr/issues/563 - + However, most browsers are not Safari and positioning is expensive when used in scale. https://github.com/chmln/flatpickr/issues/1096 */ @@ -32002,7 +32002,7 @@ module.exports = function(CodeMirror) { var _i, _a, child, _b, _c, child, _d, _e, child, _f, _g, child, _h, _j, child, _k, _l, child, _m, _o, child; return __generator(this, function (_p) { switch (_p.label) { - case 0: + case 0: // https://www.w3.org/TR/css-position-3/#painting-order // 1. the background and borders of the element forming the stacking context. return [4 /*yield*/, this.renderNodeBackgroundAndBorders(stack.element)]; @@ -32022,7 +32022,7 @@ module.exports = function(CodeMirror) { case 4: _i++; return [3 /*break*/, 2]; - case 5: + case 5: // 3. For all its in-flow, non-positioned, block-level descendants in tree order: return [4 /*yield*/, this.renderNodeContent(stack.element)]; case 6: @@ -51641,7 +51641,7 @@ function addStyle (obj, options) { // If a transform function was defined, run it on the css if (options.transform && obj.css) { result = typeof options.transform === 'function' - ? options.transform(obj.css) + ? options.transform(obj.css) : options.transform.default(obj.css); if (result) { @@ -54514,11 +54514,11 @@ class RenderHelper extends neuroglancer_annotation_type_handler__WEBPACK_IMPORTE const { gl } = shader; const aLower = shader.attribute('aLower'); const aUpper = shader.attribute('aUpper'); - context.buffer.bindToVertexAttrib(aLower, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aLower, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 6, /*offset=*/ context.bufferOffset); - context.buffer.bindToVertexAttrib(aUpper, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aUpper, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 6, /*offset=*/ context.bufferOffset + 4 * 3); gl.vertexAttribDivisor(aLower, 1); gl.vertexAttribDivisor(aUpper, 1); @@ -54534,7 +54534,7 @@ class PerspectiveViewRenderHelper extends RenderHelper { constructor() { super(...arguments); this.lineShader = this.registerDisposer(new neuroglancer_webgl_lines__WEBPACK_IMPORTED_MODULE_9__["LineShader"](this.gl, EDGES_PER_BOX)); - this.edgeBoxCornerOffsetsBuffer = this.registerDisposer(neuroglancer_webgl_buffer__WEBPACK_IMPORTED_MODULE_7__["Buffer"].fromData(this.gl, Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_5__["tile2dArray"])(edgeBoxCornerOffsetData, /*majorDimension=*/ 7, /*minorTiles=*/ 1, + this.edgeBoxCornerOffsetsBuffer = this.registerDisposer(neuroglancer_webgl_buffer__WEBPACK_IMPORTED_MODULE_7__["Buffer"].fromData(this.gl, Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_5__["tile2dArray"])(edgeBoxCornerOffsetData, /*majorDimension=*/ 7, /*minorTiles=*/ 1, /*majorTiles=*/ neuroglancer_webgl_lines__WEBPACK_IMPORTED_MODULE_9__["VERTICES_PER_LINE"]))); this.edgeShaderGetter = Object(neuroglancer_webgl_shader__WEBPACK_IMPORTED_MODULE_10__["emitterDependentShaderGetter"])(this, this.gl, (builder) => { this.defineShader(builder); @@ -54554,7 +54554,7 @@ emitAnnotation(vec4(vColor.rgb, getLineAlpha())); `); }); this.circleShader = this.registerDisposer(new neuroglancer_webgl_circles__WEBPACK_IMPORTED_MODULE_8__["CircleShader"](this.gl, CORNERS_PER_BOX)); - this.boxCornerOffsetsBuffer = this.registerDisposer(neuroglancer_webgl_buffer__WEBPACK_IMPORTED_MODULE_7__["Buffer"].fromData(this.gl, Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_5__["tile2dArray"])(neuroglancer_sliceview_bounding_box_shader_helper__WEBPACK_IMPORTED_MODULE_3__["vertexBasePositions"], /*majorDimension=*/ 3, /*minorTiles=*/ 1, + this.boxCornerOffsetsBuffer = this.registerDisposer(neuroglancer_webgl_buffer__WEBPACK_IMPORTED_MODULE_7__["Buffer"].fromData(this.gl, Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_5__["tile2dArray"])(neuroglancer_sliceview_bounding_box_shader_helper__WEBPACK_IMPORTED_MODULE_3__["vertexBasePositions"], /*majorDimension=*/ 3, /*minorTiles=*/ 1, /*majorTiles=*/ neuroglancer_webgl_circles__WEBPACK_IMPORTED_MODULE_8__["VERTICES_PER_CIRCLE"]))); this.cornerShaderGetter = Object(neuroglancer_webgl_shader__WEBPACK_IMPORTED_MODULE_10__["emitterDependentShaderGetter"])(this, this.gl, (builder) => { this.defineShader(builder); @@ -54580,11 +54580,11 @@ emitAnnotation(getCircleColor(vColor, borderColor)); this.enable(shader, context, () => { const aBoxCornerOffset1 = shader.attribute('aBoxCornerOffset1'); const aBoxCornerOffset2 = shader.attribute('aBoxCornerOffset2'); - this.edgeBoxCornerOffsetsBuffer.bindToVertexAttrib(aBoxCornerOffset1, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + this.edgeBoxCornerOffsetsBuffer.bindToVertexAttrib(aBoxCornerOffset1, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 7, /*offset=*/ 0); - this.edgeBoxCornerOffsetsBuffer.bindToVertexAttrib(aBoxCornerOffset2, /*components=*/ 4, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + this.edgeBoxCornerOffsetsBuffer.bindToVertexAttrib(aBoxCornerOffset2, /*components=*/ 4, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 7, /*offset=*/ 4 * 3); this.lineShader.draw(shader, context.renderContext, /*lineWidth=*/ 1, 1, context.count); gl.disableVertexAttribArray(aBoxCornerOffset1); @@ -54596,7 +54596,7 @@ emitAnnotation(getCircleColor(vColor, borderColor)); const { gl } = this; this.enable(shader, context, () => { const aBoxCornerOffset = shader.attribute('aBoxCornerOffset'); - this.boxCornerOffsetsBuffer.bindToVertexAttrib(aBoxCornerOffset, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + this.boxCornerOffsetsBuffer.bindToVertexAttrib(aBoxCornerOffset, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, /*normalized=*/ false); this.circleShader.draw(shader, context.renderContext, { interiorRadiusInPixels: 1, borderWidthInPixels: 0, featherWidthInPixels: 1 }, context.count); gl.disableVertexAttribArray(aBoxCornerOffset); @@ -54611,9 +54611,9 @@ function getBaseIntersectionVertexIndexArray() { return new Float32Array([0, 1, 2, 3, 4, 5]); } function getIntersectionVertexIndexArray() { - return Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_5__["tile2dArray"])(getBaseIntersectionVertexIndexArray(), - /*majorDimension=*/ 1, - /*minorTiles=*/ 1, + return Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_5__["tile2dArray"])(getBaseIntersectionVertexIndexArray(), + /*majorDimension=*/ 1, + /*minorTiles=*/ 1, /*majorTiles=*/ neuroglancer_webgl_lines__WEBPACK_IMPORTED_MODULE_9__["VERTICES_PER_LINE"]); } class SliceViewRenderHelper extends RenderHelper { @@ -54667,7 +54667,7 @@ emitAnnotation(vec4(vColor.rgb, uFillOpacity)); this.boundingBoxCrossSectionHelper.setViewportPlane(shader, context.renderContext.sliceView.viewportAxes[2], context.renderContext.sliceView.centerDataPosition, context.annotationLayer.state.globalToObject); const aVertexIndexFloat = shader.attribute('aVertexIndexFloat'); (fillOpacity ? this.filledIntersectionVertexIndexBuffer : this.intersectionVertexIndexBuffer) - .bindToVertexAttrib(aVertexIndexFloat, /*components=*/ 1, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + .bindToVertexAttrib(aVertexIndexFloat, /*components=*/ 1, /*attributeType=*/ WebGL2RenderingContext.FLOAT, /*normalized=*/ false); if (fillOpacity) { gl.uniform1f(shader.uniform('uFillOpacity'), fillOpacity); @@ -54932,11 +54932,11 @@ class RenderHelper extends neuroglancer_annotation_type_handler__WEBPACK_IMPORTE const aCenter = shader.attribute('aCenter'); const aRadii = shader.attribute('aRadii'); const { gl } = shader; - context.buffer.bindToVertexAttrib(aCenter, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aCenter, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 6, /*offset=*/ context.bufferOffset); - context.buffer.bindToVertexAttrib(aRadii, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aRadii, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 6, /*offset=*/ context.bufferOffset + 4 * 3); gl.vertexAttribDivisor(aCenter, 1); gl.vertexAttribDivisor(aRadii, 1); @@ -56670,7 +56670,7 @@ const FULL_OBJECT_PICK_OFFSET = 0; const ENDPOINTS_PICK_OFFSET = FULL_OBJECT_PICK_OFFSET + 1; const PICK_IDS_PER_INSTANCE = ENDPOINTS_PICK_OFFSET + 2; function getEndpointIndexArray() { - return Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_4__["tile2dArray"])(new Uint8Array([0, 1]), /*majorDimension=*/ 1, /*minorTiles=*/ 1, + return Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_4__["tile2dArray"])(new Uint8Array([0, 1]), /*majorDimension=*/ 1, /*minorTiles=*/ 1, /*majorTiles=*/ neuroglancer_webgl_circles__WEBPACK_IMPORTED_MODULE_8__["VERTICES_PER_CIRCLE"]); } class RenderHelper extends neuroglancer_annotation_type_handler__WEBPACK_IMPORTED_MODULE_2__["AnnotationRenderHelper"] { @@ -56726,11 +56726,11 @@ emitAnnotation(getCircleColor(vColor, borderColor)); const { gl } = shader; const aLower = shader.attribute('aEndpointA'); const aUpper = shader.attribute('aEndpointB'); - context.buffer.bindToVertexAttrib(aLower, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aLower, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 6, /*offset=*/ context.bufferOffset); - context.buffer.bindToVertexAttrib(aUpper, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aUpper, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 4 * 6, /*offset=*/ context.bufferOffset + 4 * 3); gl.vertexAttribDivisor(aLower, 1); gl.vertexAttribDivisor(aUpper, 1); @@ -56751,7 +56751,7 @@ emitAnnotation(getCircleColor(vColor, borderColor)); const shader = this.endpointShaderGetter(context.renderContext.emitter); this.enable(shader, context, () => { const aEndpointIndex = shader.attribute('aEndpointIndex'); - this.endpointIndexBuffer.bindToVertexAttribI(aEndpointIndex, /*components=*/ 1, + this.endpointIndexBuffer.bindToVertexAttribI(aEndpointIndex, /*components=*/ 1, /*attributeType=*/ WebGL2RenderingContext.UNSIGNED_BYTE); this.circleShader.draw(shader, context.renderContext, { interiorRadiusInPixels: 6, borderWidthInPixels: 2, featherWidthInPixels: 1 }, context.count); shader.gl.disableVertexAttribArray(aEndpointIndex); @@ -57073,8 +57073,8 @@ emitAnnotation(getCircleColor(vColor, borderColor)); this.enable(shader, context, () => { const { gl } = this; const aVertexPosition = shader.attribute('aVertexPosition'); - context.buffer.bindToVertexAttrib(aVertexPosition, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, + context.buffer.bindToVertexAttrib(aVertexPosition, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, /*stride=*/ 0, /*offset=*/ context.bufferOffset); gl.vertexAttribDivisor(aVertexPosition, 1); const pointSize = context.annotationLayer.state.pointSize.value; @@ -63978,7 +63978,7 @@ function getMeshMetadata(chunkManager, url) { return chunkManager.memoize.getUncounted({ 'type': 'graphene:MeshSource', url }, () => Object(neuroglancer_authentication_frontend_ts__WEBPACK_IMPORTED_MODULE_1__["authFetch"])(`${url}/info`) .then(response => { return response.json().then(value => parseMeshMetadata(value)); - }, + }, // If we fail to fetch the info file, assume it is the legacy // single-resolution mesh format. () => undefined)); @@ -65022,7 +65022,7 @@ function getMeshMetadata(chunkManager, url) { return chunkManager.memoize.getUncounted({ 'type': 'precomputed:MeshSource', url }, () => Object(neuroglancer_util_http_request__WEBPACK_IMPORTED_MODULE_10__["fetchOk"])(`${url}/info`) .then(response => { return response.json().then(value => parseMeshMetadata(value)); - }, + }, // If we fail to fetch the info file, assume it is the legacy // single-resolution mesh format. () => undefined)); @@ -69895,7 +69895,7 @@ function setupDropZone(dropZone, manager, makeLayerGroupViewer) { catch (e) { return; } - const dropLayers = Object(neuroglancer_ui_layer_drag_and_drop__WEBPACK_IMPORTED_MODULE_3__["getDropLayers"])(event, manager, /*forceCopy=*/ false, /*allowMove=*/ false, + const dropLayers = Object(neuroglancer_ui_layer_drag_and_drop__WEBPACK_IMPORTED_MODULE_3__["getDropLayers"])(event, manager, /*forceCopy=*/ false, /*allowMove=*/ false, /*newTarget=*/ true); if (dropLayers !== undefined && dropLayers.finalize(event)) { event.preventDefault(); @@ -69913,8 +69913,8 @@ function setupDropZone(dropZone, manager, makeLayerGroupViewer) { } } else { - const dropLayers = Object(neuroglancer_ui_layer_drag_and_drop__WEBPACK_IMPORTED_MODULE_3__["getDropLayers"])(event, manager, /*forceCopy=*/ Object(neuroglancer_util_drag_and_drop__WEBPACK_IMPORTED_MODULE_6__["getDropEffect"])() === 'copy', - /*allowMove=*/ false, + const dropLayers = Object(neuroglancer_ui_layer_drag_and_drop__WEBPACK_IMPORTED_MODULE_3__["getDropLayers"])(event, manager, /*forceCopy=*/ Object(neuroglancer_util_drag_and_drop__WEBPACK_IMPORTED_MODULE_6__["getDropEffect"])() === 'copy', + /*allowMove=*/ false, /*newTarget=*/ true); if (dropLayers !== undefined && dropLayers.finalize(event)) { event.preventDefault(); @@ -70208,7 +70208,7 @@ function registerDropHandlers(panel, target, targetLayer) { } } if (dropLayers === undefined) { - dropLayers = panel.dropLayers = Object(neuroglancer_ui_layer_drag_and_drop__WEBPACK_IMPORTED_MODULE_3__["getDropLayers"])(event, panel.manager, /*forceCopy=*/ dropEffect === 'copy', /*allowMove=*/ true, + dropLayers = panel.dropLayers = Object(neuroglancer_ui_layer_drag_and_drop__WEBPACK_IMPORTED_MODULE_3__["getDropLayers"])(event, panel.manager, /*forceCopy=*/ dropEffect === 'copy', /*allowMove=*/ true, /*newTarget=*/ false); if (dropLayers === undefined) { return undefined; @@ -71149,7 +71149,7 @@ function getFloatPositionHandler(glAttributeType) { builder.addVertexCode(`highp vec3 getVertexPosition() { return aVertexPosition; }`); }, bind(_gl, shader, fragmentChunk) { - fragmentChunk.vertexBuffer.bindToVertexAttrib(shader.attribute('aVertexPosition'), + fragmentChunk.vertexBuffer.bindToVertexAttrib(shader.attribute('aVertexPosition'), /*components=*/ 3, glAttributeType, /* normalized=*/ true); }, endLayer: (gl, shader) => { @@ -71172,7 +71172,7 @@ highp vec3 getVertexPosition() { `); }, bind(_gl, shader, fragmentChunk) { - fragmentChunk.vertexBuffer.bindToVertexAttribI(shader.attribute('aVertexPosition'), + fragmentChunk.vertexBuffer.bindToVertexAttribI(shader.attribute('aVertexPosition'), /*components=*/ 1, WebGL2RenderingContext.UNSIGNED_INT); }, endLayer: (gl, shader) => { @@ -71255,7 +71255,7 @@ vColor = vec4(lightingFactor * uColor.rgb, uColor.a); drawFragmentHelper(gl, shader, fragmentChunk, indexBegin, indexEnd) { this.vertexPositionHandler.bind(gl, shader, fragmentChunk); const { meshData } = fragmentChunk; - fragmentChunk.normalBuffer.bindToVertexAttrib(shader.attribute('aVertexNormal'), + fragmentChunk.normalBuffer.bindToVertexAttrib(shader.attribute('aVertexNormal'), /*components=*/ 2, WebGL2RenderingContext.BYTE, /*normalized=*/ true); fragmentChunk.indexBuffer.bind(); const { indices } = meshData; @@ -77075,7 +77075,7 @@ function helper(Base) { let chunkLow = entry[0].split(',')[0]; let chunkHigh = entry[0].split(',')[1]; let tempSegment = new neuroglancer_util_uint64__WEBPACK_IMPORTED_MODULE_21__["Uint64"](parseInt(chunkLow), parseInt(chunkHigh)); - // create a refresh promise for each segment + // create a refresh promise for each segment const promise = meshSource.rpc.promiseInvoke(neuroglancer_datasource_graphene_base__WEBPACK_IMPORTED_MODULE_3__["GRAPHENE_MANIFEST_REFRESH_PROMISE"], { 'rpcId': meshSource.rpcId, 'segment': tempSegment.toString() }); let msgTail = 'if full mesh does not appear try again after this message disappears.'; this.chunkedGraphLayer.withErrorMessage(promise, { @@ -81163,15 +81163,15 @@ let SliceView = class SliceView extends Base { gl.enable(gl.STENCIL_TEST); gl.disable(gl.DEPTH_TEST); gl.stencilOpSeparate( - /*face=*/ gl.FRONT_AND_BACK, /*sfail=*/ gl.KEEP, /*dpfail=*/ gl.KEEP, + /*face=*/ gl.FRONT_AND_BACK, /*sfail=*/ gl.KEEP, /*dpfail=*/ gl.KEEP, /*dppass=*/ gl.REPLACE); let renderLayerNum = 0; for (let renderLayer of this.visibleLayerList) { gl.clear(gl.STENCIL_BUFFER_BIT); gl.stencilFuncSeparate( - /*face=*/ gl.FRONT_AND_BACK, - /*func=*/ gl.GREATER, - /*ref=*/ 1, + /*face=*/ gl.FRONT_AND_BACK, + /*func=*/ gl.GREATER, + /*ref=*/ 1, /*mask=*/ 1); renderLayer.setGLBlendMode(gl, renderLayerNum); renderLayer.draw(this); @@ -82243,9 +82243,9 @@ gl_Position = uProjection * (pos + delta); gl.uniform1f(shader.uniform('uOpacity'), this.opacity.value); gl.uniform1f(shader.uniform('ulineWidth'), this.lineWidth.value); gl.uniform3fv(shader.uniform('uColor'), this.color.value); - this.vertexIndexBuffer.bindToVertexAttrib(shader.attribute('aVertexIndex'), + this.vertexIndexBuffer.bindToVertexAttrib(shader.attribute('aVertexIndex'), /*components=*/ 2); - this.normalDirectionBuffer.bindToVertexAttrib(shader.attribute('aNormalDirection'), + this.normalDirectionBuffer.bindToVertexAttrib(shader.attribute('aNormalDirection'), /*components=*/ 1); return shader; } @@ -82289,19 +82289,19 @@ gl_Position = uProjection * (pos + delta); if (chunk && chunk.state === neuroglancer_chunk_manager_base__WEBPACK_IMPORTED_MODULE_0__["ChunkState"].GPU_MEMORY) { let numInstances = chunk.numPoints / 2; // Two points == One vector const aVertexFirst = shader.attribute('aVertexFirst'); - chunk.vertexBuffer.bindToVertexAttrib(aVertexFirst, - /*components=*/ 3, - /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, - /*stride=*/ 6 * 4, + chunk.vertexBuffer.bindToVertexAttrib(aVertexFirst, + /*components=*/ 3, + /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, + /*stride=*/ 6 * 4, /*offset=*/ 0); gl.vertexAttribDivisor(aVertexFirst, 1); const aVertexSecond = shader.attribute('aVertexSecond'); - chunk.vertexBuffer.bindToVertexAttrib(aVertexSecond, - /*components=*/ 3, - /*attributeType=*/ WebGL2RenderingContext.FLOAT, - /*normalized=*/ false, - /*stride=*/ 6 * 4, + chunk.vertexBuffer.bindToVertexAttrib(aVertexSecond, + /*components=*/ 3, + /*attributeType=*/ WebGL2RenderingContext.FLOAT, + /*normalized=*/ false, + /*stride=*/ 6 * 4, /*offset=*/ 3 * 4); gl.vertexAttribDivisor(aVertexSecond, 1); gl.drawArraysInstanced(gl.TRIANGLE_STRIP, 0, 4, numInstances); @@ -85878,7 +85878,7 @@ class GraphOperationLayerView extends neuroglancer_widget_tab_view__WEBPACK_IMPO this.wrapper.graphOperationLayerState.value.segmentationState.value.segmentSelectionState.selectedSegment = splitRoots[0]; this.annotationLayer.segmentationState.value.segmentSelectionState.selectedSegment = splitRoots[0]; } - // Access split points mode checkbox value + // Access split points mode checkbox value let splitPointscheckbox = document.getElementById('multi-split-mode-checkbox'); let splitPointsValue = splitPointscheckbox.checked; if (splitPointsValue) { @@ -98011,10 +98011,10 @@ void emitSphere(mat4 projectionMatrix, mat4 normalTransformMatrix, vec3 centerPo } draw(shader, numInstances) { const aSphereVertex = shader.attribute('aSphereVertex'); - this.vertexBuffer.bindToVertexAttrib(aSphereVertex, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, + this.vertexBuffer.bindToVertexAttrib(aSphereVertex, /*components=*/ 3, /*attributeType=*/ WebGL2RenderingContext.FLOAT, /*normalized=*/ false); this.indexBuffer.bind(); - shader.gl.drawElementsInstanced(WebGL2RenderingContext.TRIANGLES, this.numIndices, WebGL2RenderingContext.UNSIGNED_SHORT, + shader.gl.drawElementsInstanced(WebGL2RenderingContext.TRIANGLES, this.numIndices, WebGL2RenderingContext.UNSIGNED_SHORT, /*offset=*/ 0, numInstances); shader.gl.disableVertexAttribArray(aSphereVertex); } @@ -98060,7 +98060,7 @@ function getSquareCornersArray(startX = -1, startY = -1, endX = 1, endY = 1, min startX, endY, endX, endY, endX, startY, - ]), + ]), /*majorDimension=*/ 2, minorTiles, majorTiles); } function getCubeCornersArray(startX = -1, startY = -1, startZ = -1, endX = 1, endY = 1, endZ = 1, minorTiles = 1, majorTiles = 1) { @@ -98073,7 +98073,7 @@ function getCubeCornersArray(startX = -1, startY = -1, startZ = -1, endX = 1, en endX, startY, endZ, startX, endY, endZ, endX, endY, endZ, - ]), + ]), /*majorDimension=*/ 3, minorTiles, majorTiles); } function getSquareCornersBuffer(gl, startX = -1, startY = -1, endX = 1, endY = 1, minorTiles = 1, majorTiles = 1) { @@ -98141,11 +98141,11 @@ function resizeTexture(gl, texture, width, height, internalFormat = WebGL2Render gl.activeTexture(WebGL2RenderingContext.TEXTURE0 + gl.tempTextureUnit); gl.bindTexture(WebGL2RenderingContext.TEXTURE_2D, texture); setRawTextureParameters(gl); - gl.texImage2D(WebGL2RenderingContext.TEXTURE_2D, 0, - /*internalformat=*/ internalFormat, - /*width=*/ width, - /*height=*/ height, - /*border=*/ 0, + gl.texImage2D(WebGL2RenderingContext.TEXTURE_2D, 0, + /*internalformat=*/ internalFormat, + /*width=*/ width, + /*height=*/ height, + /*border=*/ 0, /*format=*/ format, dataType, null); gl.bindTexture(WebGL2RenderingContext.TEXTURE_2D, null); } @@ -98162,8 +98162,8 @@ function setTextureFromCanvas(gl, texture, canvas) { gl.texParameteri(WebGL2RenderingContext.TEXTURE_2D, WebGL2RenderingContext.TEXTURE_WRAP_T, WebGL2RenderingContext.CLAMP_TO_EDGE); gl.pixelStorei(WebGL2RenderingContext.UNPACK_FLIP_Y_WEBGL, 1); gl.pixelStorei(WebGL2RenderingContext.UNPACK_ALIGNMENT, 4); - gl.texImage2D(WebGL2RenderingContext.TEXTURE_2D, /*level=*/ 0, - /*internalformat=*/ WebGL2RenderingContext.RGBA8, + gl.texImage2D(WebGL2RenderingContext.TEXTURE_2D, /*level=*/ 0, + /*internalformat=*/ WebGL2RenderingContext.RGBA8, /*format=*/ WebGL2RenderingContext.RGBA, WebGL2RenderingContext.UNSIGNED_BYTE, canvas); gl.pixelStorei(WebGL2RenderingContext.UNPACK_FLIP_Y_WEBGL, 0); gl.bindTexture(WebGL2RenderingContext.TEXTURE_2D, null); @@ -98368,10 +98368,10 @@ function setOneDimensionalTextureData(gl, textureLayout, format, data) { let padded = Object(neuroglancer_util_array__WEBPACK_IMPORTED_MODULE_0__["maybePadArray"])(data, requiredSize); gl.pixelStorei(WebGL2RenderingContext.UNPACK_ALIGNMENT, 1); Object(neuroglancer_webgl_texture__WEBPACK_IMPORTED_MODULE_3__["setRawTextureParameters"])(gl); - gl.texImage2D(WebGL2RenderingContext.TEXTURE_2D, - /*level=*/ 0, textureInternalFormat, - /*width=*/ textureWidth, - /*height=*/ textureHeight, + gl.texImage2D(WebGL2RenderingContext.TEXTURE_2D, + /*level=*/ 0, textureInternalFormat, + /*width=*/ textureWidth, + /*height=*/ textureHeight, /*border=*/ 0, textureFormat, format.texelType, padded); } function setThreeDimensionalTextureData(gl, format, data, width, height, depth) { @@ -98381,11 +98381,11 @@ function setThreeDimensionalTextureData(gl, format, data, width, height, depth) } gl.pixelStorei(WebGL2RenderingContext.UNPACK_ALIGNMENT, 1); Object(neuroglancer_webgl_texture__WEBPACK_IMPORTED_MODULE_3__["setRawTexture3DParameters"])(gl); - gl.texImage3D(WebGL2RenderingContext.TEXTURE_3D, - /*level=*/ 0, textureInternalFormat, - /*width=*/ width * texelsPerElement, - /*height=*/ height, - /*depth=*/ depth, + gl.texImage3D(WebGL2RenderingContext.TEXTURE_3D, + /*level=*/ 0, textureInternalFormat, + /*width=*/ width * texelsPerElement, + /*height=*/ height, + /*depth=*/ depth, /*border=*/ 0, textureFormat, format.texelType, data); } function getShaderCodeForDataType(dataType) { @@ -104472,4 +104472,4 @@ module.exports = __webpack_require__(/*! /Users/xenesd1/Projects/microns/proofre /***/ }) /******/ }); -//# sourceMappingURL=main.bundle.js.map \ No newline at end of file +//# sourceMappingURL=main.bundle.js.map diff --git a/neuvue_project/workspace/static/workspace/tfjs-library.bundle.js b/neuvue_project/workspace/static/workspace/tfjs-library.bundle.js index ec358125..f4e6cda0 100644 --- a/neuvue_project/workspace/static/workspace/tfjs-library.bundle.js +++ b/neuvue_project/workspace/static/workspace/tfjs-library.bundle.js @@ -24295,13 +24295,13 @@ Script.prototype.runInContext = function (context) { if (!(context instanceof Context)) { throw new TypeError("needs a 'context' argument."); } - + var iframe = document.createElement('iframe'); if (!iframe.style) iframe.style = {}; iframe.style.display = 'none'; - + document.body.appendChild(iframe); - + var win = iframe.contentWindow; var wEval = win.eval, wExecScript = win.execScript; @@ -24310,7 +24310,7 @@ Script.prototype.runInContext = function (context) { wExecScript.call(win, 'null'); wEval = win.eval; } - + forEach(Object_keys(context), function (key) { win[key] = context[key]; }); @@ -24319,11 +24319,11 @@ Script.prototype.runInContext = function (context) { win[key] = context[key]; } }); - + var winKeys = Object_keys(win); var res = wEval.call(win, this.code); - + forEach(Object_keys(win), function (key) { // Avoid copying circular objects like `top` and `window` by only // updating existing context properties or new properties in the `win` @@ -24338,9 +24338,9 @@ Script.prototype.runInContext = function (context) { defineProp(context, key, win[key]); } }); - + document.body.removeChild(iframe); - + return res; }; @@ -24428,4 +24428,4 @@ exports.createContext = Script.createContext = function (context) { /***/ }) }]); -//# sourceMappingURL=tfjs-library.bundle.js.map \ No newline at end of file +//# sourceMappingURL=tfjs-library.bundle.js.map diff --git a/neuvue_project/workspace/views/task.py b/neuvue_project/workspace/views/task.py index 64b227f1..a55e21f4 100644 --- a/neuvue_project/workspace/views/task.py +++ b/neuvue_project/workspace/views/task.py @@ -299,7 +299,7 @@ def post(self, request, *args, **kwargs): sieve={"assignee": group_to_pull_from, "namespace": namespace}, limit=num_tasks, select=["_id"], - sort="-priority" + sort="-priority", ) if len(unassigned_tasks) == 0: # Warn the user that no tasks are left in the queue diff --git a/neuvue_project/workspace/views/tools.py b/neuvue_project/workspace/views/tools.py index 6795b8a1..0854f916 100644 --- a/neuvue_project/workspace/views/tools.py +++ b/neuvue_project/workspace/views/tools.py @@ -13,7 +13,7 @@ construct_nuclei_state, get_from_state_server, get_from_json, - construct_url_from_existing + construct_url_from_existing, ) from ..utils import is_url, is_json, is_authorized @@ -32,10 +32,10 @@ def get(self, request, task_id=None, *args, **kwargs): ) context = { - "task_id": task_id, + "task_id": task_id, "ng_state": None, - "ng_url": None, - "error": None, + "ng_url": None, + "error": None, "num_edits": 0, } @@ -60,9 +60,9 @@ def get(self, request, task_id=None, *args, **kwargs): if is_url(ng_state): if namespace_obj.ng_host != NeuroglancerHost.NEUVUE: # Assume its a url to json state - context['ng_state'] = ng_state - context['ng_url'] = construct_url_from_existing( - context['ng_state'], namespace_obj.ng_host + context["ng_state"] = ng_state + context["ng_url"] = construct_url_from_existing( + context["ng_state"], namespace_obj.ng_host ) else: logging.debug("Getting state from JSON State Server") diff --git a/neuvue_project/workspace/views/workspace.py b/neuvue_project/workspace/views/workspace.py index 46006516..0a0aebb7 100644 --- a/neuvue_project/workspace/views/workspace.py +++ b/neuvue_project/workspace/views/workspace.py @@ -9,7 +9,13 @@ from neuvue.client import client -from ..models import Namespace, UserProfile, ForcedChoiceButtonGroup, ForcedChoiceButton, NeuroglancerHost +from ..models import ( + Namespace, + UserProfile, + ForcedChoiceButtonGroup, + ForcedChoiceButton, + NeuroglancerHost, +) from ..neuroglancer import ( construct_proofreading_state, construct_url_from_existing, @@ -134,7 +140,9 @@ def get(self, request, namespace=None, **kwargs): # Pass User configs to Neuroglancer try: - config = Config.objects.filter(user=str(request.user)).order_by("-id")[0] + config = Config.objects.filter(user=str(request.user)).order_by("-id")[ + 0 + ] context["show_slices"] = config.show_slices except Exception as e: logging.error(e) @@ -149,7 +157,7 @@ def get(self, request, namespace=None, **kwargs): if is_url(ng_state): if namespace_obj.ng_host != NeuroglancerHost.NEUVUE: # Assume its a url to json state - context['ng_state'] = ng_state + context["ng_state"] = ng_state else: logging.debug("Getting state from JSON State Server") context["ng_state"] = get_from_state_server(ng_state) @@ -175,8 +183,8 @@ def get(self, request, namespace=None, **kwargs): context["ng_state"] = refresh_ids(context["ng_state"], namespace) else: - context['ng_url'] = construct_url_from_existing( - context['ng_state'], namespace_obj.ng_host + context["ng_url"] = construct_url_from_existing( + context["ng_state"], namespace_obj.ng_host ) ############################# ALLOW TO REASSIGN ######################################## @@ -222,7 +230,7 @@ def post(self, request, *args, **kwargs): # All form submissions include button name and ng state button = request.POST.get("button") - ng_state = request.POST.get("ngState", task_df['ng_state']) + ng_state = request.POST.get("ngState", task_df["ng_state"]) duration = int(request.POST.get("duration", 0)) tags = request.POST.get("tags") session_task_count = request.session.get("session_task_count", 0) @@ -304,7 +312,8 @@ def post(self, request, *args, **kwargs): try: new_priority = task_df["priority"] - namespace_obj.decrement_priority - if new_priority < 0: new_priority = 0 + if new_priority < 0: + new_priority = 0 client.patch_task( task_df["_id"], duration=duration, diff --git a/requirements-dev.txt b/requirements-dev.txt index 9f520906..20420596 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,2 +1,2 @@ pre-commit -black \ No newline at end of file +black