Code Monkey home page Code Monkey logo

aiidalab-widget-periodictable's Introduction

aiidalab-widget-periodictable

NOTE!! THIS HAS BEEN SUPERSEDED BY THE WIDGET-PERIODICTABLE DEVELOPED BY THE OSSCAR PROJECT!!

A jupyter widget to select chemical elements from the periodic table

Binder

Installation

NOTE: this package is not yet on pip.

To install use pip:

$ pip install aiidalab_widget_periodictable
$ jupyter nbextension enable --py --sys-prefix aiidalab_widget_periodictable

For a development installation (requires npm),

$ git clone https://github.com/aiidalab/aiidalab-widget-periodictable.git
$ cd aiidalab-widget-periodictable
$ pip install -e .
$ jupyter nbextension install --py --symlink --sys-prefix aiidalab_widget_periodictable
$ jupyter nbextension enable --py --sys-prefix aiidalab_widget_periodictable

Alternatively, you can also simply call the reinstall.sh script that calls the last three steps.

After this, you need both to refresh the page, and restart the kernel.

If you just changed the JS part, you can run a bit faster by running only the ./jsonlyreinstall.sh script and then refreshing the page.

aiidalab-widget-periodictable's People

Contributors

giovannipizzi avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

dou-du

aiidalab-widget-periodictable's Issues

Clean up the javascript code

  • Add linters
  • use a backbone.js template as a different file rather than a convoluted string in the js
  • Add minifiers for CSS and JS in production

Extend the widget to also provide a list of known structures

This should be optional.
If a list of known_structures is passed from python, in the form

known_structures = [
  [0, "BaTiO<sub>3</sub>", ["Ba", "Ti", "O"]],
  [1, "Fe", ["Fe"]],
  ...
]

(i.e. a list of lists of length three, being an ID (can be a string, an integer, ... - no checks should be done); a string to be rendered in HTML; and a list of elements in the structure), then:

  • show a list of elements near the periodic table (possibly with a text-search like on Materials Cloud/discover/2d?), in the order specified
  • disable all chemical elements not present in any of the structures
  • bind the content of the list to show only the elements that have at least one element selected (or show all if none is selected?)
  • when a structure is selected, update a new attribute selected_structure (but give a way to unselect it) with the ID of the selected structure.

Note: IDs are not required to be unique (but then, there return value will not make it possible to distinguish what has been clicked... but for some cases this might be ok, e.g. if the ID is used to generate a URL, and two entries point to the same URL).

For the latter point, an option could be to provide instead a link to jump when clicking, but for a widget typically it is better to provide the data back without jumping to a different page (if needed, this can be done from python, observing events on the selected_structure variable and redirecting if a valid structure has been selected).

Improve appearance

  • Choose final colours and style; understand the widget behaviour on small screens
  • Understand if we want/it is possible easily to make the colours, size, ... customisable (in this case, maybe the colours should be set via a dictionary, per element, like on SSSP?)
  • Allow to pass a dictionary from python to change the label of elements (e.g. on SSSP, adding subscripts etc).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.