npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fx.genetics

v1.0.0

Published

A genetics library for fxhash open-form generative artworks, modeling trait inheritance and evolution across generations.

Downloads

76

Readme

fx.genetics

A genetics library for fxhash open-form generative artworks, modeling trait inheritance and evolution across generations. Think CryptoKitties-inspired crossing for open-form generative artworks.

It simplifies the evolution phase of open-form pieces and brings organic digital evolution to generative artworks. Generative artists no longer need to worry about manually handling how traits evolve with depth – the genetics system takes care of it. This lets you focus on designing and implementing how those traits actually manifest in your artwork.

The library is distributed as browser-ready JavaScript files and is currently proprietary. An open-source release may be considered in the future based on community support. For licensing inquiries, contact the author.

What it enables

  • Combine two pieces from the lineage and produce an offspring from the parents traits
  • Enable trait mutations triggered by specific parent trait combinations
  • Automatic feature registration with $fx.features()
  • Configurable genetics for open-form projects, including:
    • Parent selection from lineage (built-ins or custom strategy)
    • Hidden variant counts per trait and their swap/weight chances
    • Mutation rules based on parent traits and depth-based chances
    • Anomaly injection by depth-based chances

Quick start

Install via npm:

npm i fx.genetics

At runtime, use the browser build (not a Node module). Include fxhash first, then fx.genetics:

<script src="./fxhash.min.js"></script>
<script src="./fx.genetics.min.js"></script>
<script src="./index.js"></script>

Example

An example showing schema definition, configuration, evolution, and trait access:

const schema = [
    { id: "S", name: "Shape", variants: ["Ellipse", "Rectangle"],
        mutations: [{
            value: "Triangle", requires: ["S:Ellipse", "S:Rectangle"]
        }]
    },
    { name: "Color", variants: ["Red", "Green", "Blue"] },
    { name: "Chaos", variants: [0, 50, 100] },
    { name: "Grain", variants: [true, false] },
];

$fx.genetics(schema)
    .mode("tiered")             // CryptoKittes-inspired crossing
    .parents("sliding")         // defines how parents are selected
    .hidden([0.25, 0.25, 0.25]) // defines hidden traits chances
    .mutations([0, 0.15, 0.25]) // defines mutation chances by depth
    .anomalies([0, 0.05])       // defines anomaly chances by depth
    .evolve();

// Features are registered automatically with fxhash
// $fx.features() now includes Shape, Color, Chaos, Grain

// Access the expressed traits (phenotype) for the current iteration:
const shapeViaFeature = $fx.getFeature("Shape");
const shapeViaName = $DNA.getTrait("Shape").value;
const shapeViaId = $DNA.getTrait("#S").value;

// Trait identifiers can be the gene name ("Shape") or the gene id ("#S")

Note: $DNA is a convenience alias for $fx.genetics. For example:

$DNA(schema).evolve();
// is the same as:
$fx.genetics(schema).evolve();

const trait = $DNA.getTrait("Shape").value;
// is the same as:
const trait = $fx.genetics.getTrait("Shape").value;

Go to top ⬆

Support

Need help or found issues?

License holders receive the full in-depth REFERENCE.md library documentation.

License

Copyright (c) 2026 Joseph Miclaus. All rights reserved.

For licensing inquiries, contact the author.