Code Monkey home page Code Monkey logo

bare-minimum-2d's Introduction

bare-minimum-2d's People

Contributors

dependabot[bot] avatar fuddl avatar mikong avatar mithi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bare-minimum-2d's Issues

TODO: Use parcel instead of CRA

CRA installs babel jest in the example directory which is unused.
This babel jest causes problems because we need to have babel jest on the root directory,
having two separate versions of babel jest (and related libraries) - one for the root directory and the other to its child directory (in this case is the child directory is the example directory)- is preventing a successful build.

The solution is to use parcel instead of CRA. It will not install babel jest (and related libraries) in the example directory

TODO: Be able to use and render custom markers (plus, triangle, etc)

Markers

  • Add an element type called "markers"
    If an element is of type markers, you should specify amarkerType like

  • "plus"

  • "plus-circle"

  • "plus-square"

  • "triangle"

  • "mouse-pointer"

  • "arrow-up-circle"

  • "arrow-up"

To use, you can pass it to the data array like so:

const markers1 = {
  x: [0, -50, -50, 50, 50],
  y: [0, -50, 50, 50, -50],
  theta: 0,
  color: 'red',
  opacity: 0.75,
  size: 5,
  type: 'markers',
  markerType: 'arrow-up',
  id: 'marker1'
}

const markers2 = {
  x: [0, 0, 0, 0],
  y: [-20, -10, 10, 20],
  theta: -45,
  color: 'purple',
  opacity: 0.75,
  size: 3,
  type: 'markers',
  markerType: 'plus-circle',
  id: 'markers2'
}

Resolve registry conflict

SOLUTION

$ npm login --registry=https://npm.pkg.github.com --scope=@mithi
$ npm publish --dry-run

from NPM docs

https://docs.npmjs.com/misc/scope

You can associate a scope with a registry at login, e.g.

npm config set @myco:registry http://reg.example.com

Once a scope is associated with a registry, any npm install for a package with that scope will request packages from that registry instead. Any npm publish for a package name that contains the scope will be published to that registry instead.

Problem

v0.1.12 on GitHub registry
https://github.com/mithi/bare-minimum-2d/packages/352301

v0.1.11 on NPM registry
https://www.npmjs.com/package/bare-minimum-2d

But there is actually no difference between the two versions

Notes

npm publish will publish to the github registry because of .npmrc file below
https://github.com/mithi/bare-minimum-2d/blob/master/.npmrc
which has

registry=https://npm.pkg.github.com/mithi

BUT BEFORE PUBLISHING, you need to edit package.json
https://github.com/mithi/bare-minimum-2d/blob/master/package.json
to be

{
  "name": "@mithi/bare-minimum-2d",
  "version": "0.1.12",
}

and to publish to the npm registry, you'd have to remove .npmrc file
and change the name back to { "name": "bare-minimum-2d" }

This is of course a hack which should be resolved.

Please refer to the following in the docs:
https://docs.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages#publishing-packages-to-npm-and-github-packages

Note: If you need to publish to registries that have different scope prefixes, you'll need to modify the package.json file on the runner to change the scope prefix. For example, if you publish a package to the @mona scope for npm and @octocat scope for GitHub Packages, you can replace the @mona scope with @octocat in the package.json file on the runner after publishing to npm and before publishing to GitHub Packages.

TODO: Be able to specify and render just one or two quadrants instead of the four

Currently, when we specify the x-range the y-range of the container the default plot would be like so:

                  yRange/2
                     | 
               Q2    |      Q1
  -xRange/2 -------(0,0)--------- xRange/2
               Q3    |      Q4
                     |    
                 -yRange/2

Sometimes we only need one of the following

  • Q1
  • Q2
  • Q3
  • Q4
  • Q1 + Q2
  • Q3 + Q4
  • Q1 + Q4
  • Q2 + Q3
  • Q1 + Q2 + Q3 + Q4

We should be able to specify, so that we don't waste space in the screen that don't have markers.
I'm thinking the API would be something like:

const container = { xRange, yRange, color, opacity, quadrants }

Where quadrant is a string that could contain "Q12", "Q3", "Q1234" etc

We have to change this part

transformX = (x) => x + this.xRange / 2
transformY = (y) => this.yRange / 2 - y

to not be hard coded and be generic

Markers with a text label

Hi,

I'd like to append text labels to each marker:

nearby stars

these should also make sure not to overlap with other text markers.

please let me know if this exceeds the boundaries of bare minimum ๐Ÿ˜….

Would It be possible to define a marker type as a plug-in? such a plug-in could be used to solve #1

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.