Giter Club home page Giter Club logo

Comments (5)

eweitz avatar eweitz commented on June 4, 2024

Hello Abigail! Thanks for your interest.

Have you given any thought to exporting the Ideogram object as an es2015 module?

Not yet, but that seems worthwhile. I am on the cusp of wrapping up some enhancements to ploidy support; after that, I will work on exporting Ideogram as an ES2015 module.

from ideogram.

awatson1978 avatar awatson1978 commented on June 4, 2024

Oh, that would be great. From what I can gather, the biggest change would be in pointing the package.json main field to an index.js instead of gulpfile.js.

// package.json
{
  "main": "lib/index.js"
}

It's pretty common pattern to have the index file then include and export the various files in the package.

// index.js
'use strict';
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.Ideogram = undefined;
var _Ideogram = require('./Ideogram');
exports.Ideogram = _Ideogram.default;

At 3,000+ lines, it might be worth spliting up ideogram.js into:

// directory
lib/Chromosome.js
lib/Layout.js
lib/Ploidy.js
lib/Ideogram.js

And then just export the object. There's a few different patterns for this that are detected differently by different build pipelines... Meteor, Webpack, etc. Not sure I have a definitive answer. Just copying the pattern from Material UI.

// Ideogram.js
var Ideogram = {}
exports.default = Ideogram;

from ideogram.

eweitz avatar eweitz commented on June 4, 2024

Thanks, that's helpful guidance.

from ideogram.

eweitz avatar eweitz commented on June 4, 2024

I've been working on this in eweitz:es6-export. While developing support for the new standard module syntax, I have also been updating Ideogram to use ES6 / ES2015 class syntax, and generally improving internal documentation and code styling. It's a significant internal migration for Ideogram.

The work is roughly 75% done. I've got the new exporting and class syntax working locally for most examples, but several examples still have errors and the test suite still needs to be migrated.

It is difficult to estimate when it will be complete, as the personal time I have to develop Ideogram has been limited over the past month or so and will likely become even scarcer for at least the next few months. That said, I will continue to focus on this issue in what time I do have available for Ideogram.

from ideogram.

eweitz avatar eweitz commented on June 4, 2024

@awatson1978, Ideogram is now exported as an ES2015 module.

Installation:
npm install ideogram

Import:
import Ideogram from 'ideogram';

You can still also load Ideogram directly from a script tag, as seen in the examples.

from ideogram.

Related Issues (20)

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.