DouglasConnect / jsme-react

11 stars 13 forks source link

Parameters not working in my implementation for jsme-react #4

Open mwbouwkamp opened 3 years ago

mwbouwkamp commented 3 years ago

I have the following implementation of jsme-react. Settings are working nicely (these are passed in as props), but the guicolor is not set. I probably implemented it incorrectly. Hope you can help.

import React, { createElement } from "react";
import { Jsme } from "jsme-react";

interface Props {
    settings: string;
    smiles: string;
    onStructureChange: (smiles: string) => void;
}

export const JSMEMain: React.FC<Props> = props => {
    return (
        <div>
            <Jsme
                height="300px"
                width="400px"
                options={props.settings}
                guicolor="#FF0000"
                smiles={props.smiles}
                onChange={props.onStructureChange}
            />
        </div>
    );
};
danyx23 commented 3 years ago

At the moment only the options string is supported, the parameters (described in the parameters section here https://peter-ertl.com/jsme/JSME_2020-06-11/doc.html) of which guicolor is one is not currently passed on to JSME. I had a quick attempt at changing this (you can have a look in the parameters branch in this repo) but this seems not to work as expected. If you want to investigate to implement this I would be happy to accept a PR :)