Skip to content

Commit

Permalink
colour selected atoms
Browse files Browse the repository at this point in the history
  • Loading branch information
mhekkel committed Feb 4, 2025
1 parent ed38f32 commit aa4a34f
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 62 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ if(BUILD_WEB_APPLICATION)
${PROJECT_SOURCE_DIR}/webapp/optimized.js
${PROJECT_SOURCE_DIR}/webapp/lists.js
${PROJECT_SOURCE_DIR}/webapp/wait.js
${PROJECT_SOURCE_DIR}/scss/pdb-redo-bootstrap.scss
${PROJECT_SOURCE_DIR}/scss/style.scss
${PROJECT_SOURCE_DIR}/webpack.config.js)

set(webpack_output ${PROJECT_SOURCE_DIR}/docroot/scripts/index.js)
Expand Down
2 changes: 1 addition & 1 deletion docroot/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<z:block z:replace="${links}"></z:block>

<link rel='stylesheet' type="text/css" z:href='@{/css/pdb-redo-bootstrap.css}' />
<link rel='stylesheet' type="text/css" z:href='@{/css/style.css}' />

<script defer="defer" type="text/javascript" z:src="@{/scripts/index.js}"></script>

Expand Down
2 changes: 1 addition & 1 deletion docs/pdb-redo/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% endblock %}

{% block linktags %}
<link rel='stylesheet' type="text/css" z:href='@{/css/pdb-redo-bootstrap.css}' />
<link rel='stylesheet' type="text/css" z:href='@{/css/style.css}' />
{% endblock %}

{% block body_tag %}
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"sass": "^1.43.4",
"sass-loader": "^16.0.4",
"terser-webpack-plugin": "^5.2.5",
"ts-loader": "^9.2.6",
"webpack": "^5.60.0",
"webpack-cli": "^6.0.1"
},
Expand Down
File renamed without changes.
10 changes: 7 additions & 3 deletions webapp/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,15 @@ window.addEventListener('load', () => {
const asymID = row.getAttribute('data-asym-id');
const cb = row.querySelector("input[type='checkbox']");

if (cb.checked)
viewer.visual.focus([{ struct_asym_id: asymID }]);
if (cb.checked) {
viewer.visual.select({ data: [{ struct_asym_id: asymID, color: "#2378de" }] })
.then(() => viewer.visual.focus([{ struct_asym_id: asymID }]));
}
else {
cb.checked = true;
updateModel(viewer, cbs, showAllCB).then(() => viewer.visual.focus([{ struct_asym_id: asymID }]));
updateModel(viewer, cbs, showAllCB)
.then(() => viewer.visual.focus([{ struct_asym_id: asymID }]))
.then(() => viewer.visual.select({ data: [{ struct_asym_id: asymID, color: "#2378de" }] }));
}
});
});
Expand Down
5 changes: 3 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ module.exports = (env) => {
const webpackConf = {

entry: {
'pdb-redo-bootstrap': path.resolve(SCSS, "pdb-redo-bootstrap.scss"),
'style': path.resolve(SCSS, "style.scss"),
'index': path.resolve(SCRIPTS, "index.js"),
'model': path.resolve(SCRIPTS, "model.js"),
'optimized': path.resolve(SCRIPTS, "optimized.js"),
'lists': path.resolve(SCRIPTS, "lists.js"),
'wait': path.resolve(SCRIPTS, "wait.js"),
'molstar': path.resolve('node_modules/pdbe-molstar/build/', "pdbe-molstar-light.css")
},

output: {
Expand Down Expand Up @@ -62,7 +63,7 @@ module.exports = (env) => {
},

resolve: {
extensions: ['.js', '.scss'],
extensions: ['.js', '.scss', '.css'],
},

optimization: { minimizer: [] },
Expand Down
56 changes: 3 additions & 53 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1409,13 +1409,6 @@ ajv@^8.0.0, ajv@^8.9.0:
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"

ansi-styles@^4.1.0:
version "4.3.0"
resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"

argparse@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
Expand Down Expand Up @@ -1728,14 +1721,6 @@ ccount@^2.0.0:
resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5"
integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==

chalk@^4.1.0:
version "4.1.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
dependencies:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

character-entities-html4@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b"
Expand Down Expand Up @@ -1799,18 +1784,6 @@ coa@0.3.x:
dependencies:
q "~0.8.10"

color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"

color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==

colorette@^2.0.14:
version "2.0.20"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a"
Expand Down Expand Up @@ -2286,7 +2259,7 @@ encodeurl@~2.0.0:
resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-2.0.0.tgz#7b8ea898077d7e409d3ac45474ea38eaf0857a58"
integrity sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==

enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.1:
enhanced-resolve@^5.17.1:
version "5.18.0"
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz#91eb1db193896b9801251eeff1c6980278b1e404"
integrity sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ==
Expand Down Expand Up @@ -3719,7 +3692,7 @@ micromark@^4.0.0:
micromark-util-symbol "^2.0.0"
micromark-util-types "^2.0.0"

micromatch@^4.0.0, micromatch@^4.0.5:
micromatch@^4.0.5:
version "4.0.8"
resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
Expand Down Expand Up @@ -4575,7 +4548,7 @@ semver@^6.3.1:
resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.4, semver@^7.5.4:
semver@^7.5.4:
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==
Expand Down Expand Up @@ -4737,11 +4710,6 @@ source-map@^0.6.0:
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==

source-map@^0.7.4:
version "0.7.4"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656"
integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==

space-separated-tokens@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz#1ecd9d2350a3844572c3f4a312bceb018348859f"
Expand Down Expand Up @@ -4821,13 +4789,6 @@ style-to-object@^1.0.0:
dependencies:
inline-style-parser "0.2.4"

supports-color@^7.1.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
dependencies:
has-flag "^4.0.0"

supports-color@^8.0.0:
version "8.1.1"
resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c"
Expand Down Expand Up @@ -4900,17 +4861,6 @@ trough@^2.0.0:
resolved "https://registry.yarnpkg.com/trough/-/trough-2.2.0.tgz#94a60bd6bd375c152c1df911a4b11d5b0256f50f"
integrity sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==

ts-loader@^9.2.6:
version "9.5.2"
resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.5.2.tgz#1f3d7f4bb709b487aaa260e8f19b301635d08020"
integrity sha512-Qo4piXvOTWcMGIgRiuFa6nHNm+54HbYaZCKqc9eeZCLRy3XqafQgwX2F7mofrbJG3g7EEb+lkiR+z2Lic2s3Zw==
dependencies:
chalk "^4.1.0"
enhanced-resolve "^5.0.0"
micromatch "^4.0.0"
semver "^7.3.4"
source-map "^0.7.4"

tslib@^2.1.0, tslib@^2.8.0:
version "2.8.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
Expand Down

0 comments on commit aa4a34f

Please sign in to comment.