Giter VIP home page Giter VIP logo

organicvisu's Introduction

OrganicVisu

Visualisation of organic compounds by name.

Usage

User opens index.html, draws compound name into the text field and clicks Draw.

Supported structures

Currently supported chemical structures are:

  • Base string (metan, etan, propan, ..., oktan)
  • Alkyls (metyl, etyl, propyl, ..., oktyl)
  • Alcohols (metan-1-ol, etan-1-ol...)

These structures can be arbitrarly combined. Implicit positioning (works metyletan as well as metyl-1-etan) is available only for alkyls.

File structure

.
├── p5.js - p5 library
├── sketch.js - main script
├── constants.js - conversion between string and number encoding
├── carbon.js - contains Yl and Carbon classes
├── compound.js - contains Compound class
└── addons - currently not in use

Internal structure

Scripts are called in following order: p5.js -> constants.js -> carbon.js -> compound.js -> sketch.js. Algorithm starts with function drawCompound()@sketch.js, which is called after user presses button. New Compound object is created.

Compound class

Represents whole compound. Compound parses input string using the function Compound.parse(). Compound stores array of Carbon objects in Compound.base. It also stores an array of Yl objects.

Carbon class

Represents one unit (for ex. CH3, OH...). Contains exact xy position where to be rendered.

Yl class

Represents an addition to base string (alkyls and alcohols). It contains an array or Carbon objects - Yl.base.

Rendering

Every class contains render function. Compound.render() calls Carbon.render(), which renders base carbons and calls Yl.render().

organicvisu's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

organicvisu's Issues

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.