Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mantine7 #111

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"@types/react-dom": "~18.2.0",
"react": "~18.2.0",
"react-dom": "~18.2.0",
"[email protected]": "patch:vega-lite@npm:4.16.8#.yarn/patches/vega-lite-npm-4.16.8-2acecf824b.patch"
"[email protected]": "patch:vega-lite@npm:4.16.8#.yarn/patches/vega-lite-npm-4.16.8-2acecf824b.patch",
"visyn_core": "git+ssh://[email protected]/datavisyn/visyn_core#mantine7"
},
"visyn": {
"entries": {
Expand Down
5 changes: 4 additions & 1 deletion src/Backend/ReactionCIMEBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@

protected cache = {};

constructor(public readonly baseUrl: string, public readonly fetchParams: Parameters<typeof fetch>[1] = {}) {}
constructor(
public readonly baseUrl: string,
public readonly fetchParams: Parameters<typeof fetch>[1] = {},
) {}

protected handleSmilesCache = (smiles: string, highlight = false) => {
// already downloaded this image -> saved in smiles cache
Expand Down Expand Up @@ -47,7 +50,7 @@

handleJSONErrors = (data) => {
if (Object.keys(data).includes('error')) {
alert(data.error);

Check warning on line 53 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Unexpected alert
}
return data;
};
Expand All @@ -68,7 +71,7 @@
});
};

public deleteFile = async (filename): Promise<{ deleted: any }> => {

Check warning on line 74 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Unexpected any. Specify a different type
const path = `${this.baseUrl}/delete_file/${encodeURIComponent(filename)}`;

return fetch(path, {
Expand All @@ -79,7 +82,7 @@
.then((response) => response.json())
.then(this.handleJSONErrors)
.catch((error) => {
alert('file could not be deleted. please, try again');

Check warning on line 85 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Unexpected alert
console.log(error);
});
};
Expand Down Expand Up @@ -161,12 +164,12 @@
throw Error(`Backend responded with error: ${data.error}`);
})
.catch((error) => {
alert('could not find substructure match');

Check warning on line 167 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Unexpected alert
console.log(error);
});
};

public terminate_projection = async (filename): Promise<{ response: any }> => {

Check warning on line 172 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Unexpected any. Specify a different type
const path = `${this.baseUrl}/terminate_projection_thread/${encodeURIComponent(filename)}`;

return fetch(path, {
Expand Down Expand Up @@ -255,7 +258,7 @@
if (error.name === 'AbortError') {
console.log('Fetch aborted');
} else {
alert('error when uploading file. it might be too big');

Check warning on line 261 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Unexpected alert
console.log(error);
}
});
Expand Down Expand Up @@ -316,7 +319,7 @@

public loadCategoryCountOfHex = async (filename: string, col_name: string, xChannel: string, yChannel: string, x: number, y: number, circ_radius: number) => {
if (xChannel == null) {
xChannel = 'x';

Check warning on line 322 in src/Backend/ReactionCIMEBackend.ts

View workflow job for this annotation

GitHub Actions / build / Node

Assignment to function parameter 'xChannel'
}
if (yChannel == null) {
yChannel = 'y';
Expand Down
9 changes: 4 additions & 5 deletions src/ReactionCIMEApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
import HelpIcon from '@mui/icons-material/Help';
import { IconButton, Tooltip } from '@mui/material';
import { useVisynAppContext, VisynApp, VisynHeader } from 'visyn_core/app';
import { Anchor, useMantineTheme } from '@mantine/core';
import { Anchor, useMantineTheme, MantineColorShade } from '@mantine/core';

import { BrowserRouter, useSearchParams } from 'react-router-dom';
import { IClientConfig } from 'visyn_core/base';
import { LineUpContext } from './LineUpContext';
import { LineUpTabPanel } from './Overrides/LineUpTabPanel';
import { AppState, CIME4RViewActions, createCIMERootReducer } from './State/Store';
Expand Down Expand Up @@ -174,7 +173,7 @@
baseUrl: ReactionCIMEBackendFromEnv.baseUrl,
}}
features={{
embeddings: clientConfig?.publicVersion

Check failure on line 176 in src/ReactionCIMEApp.tsx

View workflow job for this annotation

GitHub Actions / build / Node

Property 'publicVersion' does not exist on type 'IClientConfig'.
? [
{
id: 'noProjection',
Expand Down Expand Up @@ -264,12 +263,12 @@
<PSEContextProvider context={context}>
<VisynApp
header={
clientConfig?.publicVersion ? (

Check failure on line 266 in src/ReactionCIMEApp.tsx

View workflow job for this annotation

GitHub Actions / build / Node

Property 'publicVersion' does not exist on type 'IClientConfig'.
// eslint-disable-next-line react/jsx-no-useless-fragment
<></>
) : (
<VisynHeader
backgroundColor={theme.colors.dark[theme.fn.primaryShade()]}
backgroundColor={theme.colors.dark[theme.primaryShade as MantineColorShade]}
components={{
aboutAppModal: {
content: <BuildInfoContent />,
Expand All @@ -286,7 +285,7 @@
href="https://www.bayer.com/"
rel="noreferrer"
target="_blank"
sx={{
style={{
// Center the image
display: 'flex',
alignItems: 'center',
Expand All @@ -298,7 +297,7 @@
href="https://jku-vds-lab.at/"
rel="noreferrer"
target="_blank"
sx={{
style={{
// Center the image
display: 'flex',
alignItems: 'center',
Expand Down
6 changes: 3 additions & 3 deletions src/Utility/HeaderCustomization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import vdsLogo from '../assets/jku-vds-lab-logo.svg';

export function BuildInfoContent() {
return (
<Stack spacing="xl">
<Stack gap="xl">
<Text>
CIME4R is a web-based tool for interactive exploration of chemical reaction optimization data. CIME4R allows chemists to better understand the decision
process of AI models and enhances human-AI collaboration.
Expand All @@ -16,8 +16,8 @@ export function BuildInfoContent() {

export function BuildInfoLogos() {
return (
<Group align="center" noWrap>
<Anchor href="https://bayer.com/" rel="noreferrer noopener" target="_blank" sx={{ transform: 'scale(1.3)' }}>
<Group align="center" wrap="nowrap">
<Anchor href="https://bayer.com/" rel="noreferrer noopener" target="_blank" style={{ transform: 'scale(1.3)' }}>
<img src={bayerLogo} alt="logo" style={{ height: '24px' }} />
</Anchor>
<Anchor href="https://jku-vds-lab.at/" rel="noreferrer noopener" target="_blank">
Expand Down
2 changes: 1 addition & 1 deletion src/initialize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import 'lineupjs/build/LineUpJS.css';

// Globally extend the clientConfig
declare module 'visyn_core/base' {

Check failure on line 9 in src/initialize.tsx

View workflow job for this annotation

GitHub Actions / build / Node

Invalid module name in augmentation, module 'visyn_core/base' cannot be found.
export interface IClientConfig {
publicVersion?: boolean;
}
}

createRoot(document.getElementById('app')).render(
<VisynAppProvider appName="CIME4R">
<VisynAppProvider disableMantine6 appName="CIME4R">
<ReactionCIMEApp />
</VisynAppProvider>,
);
Loading