forked from weng-lab/logojs-package
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f23ab9
commit 3936229
Showing
5 changed files
with
69 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from "react"; | ||
|
||
import { A, C, G, U } from "../glyphs"; | ||
import { Logo, LogoProps } from "./Logo"; | ||
import { UserDefinedAlphabet } from "../../types"; | ||
|
||
/** | ||
* Represents the RNA alphabet, with the four nucleotides colored | ||
* in a similar scheme to the MEME default. | ||
*/ | ||
export const RNAAlphabet = [ | ||
{ component: A, regex: "A", color: "red" }, | ||
{ component: C, regex: "C", color: "blue" }, | ||
{ component: G, regex: "G", color: "orange" }, | ||
{ component: U, regex: "U", color: "seagreen" }, | ||
]; | ||
|
||
export type RNALogoProps = Omit<LogoProps, "alphabet"> & { | ||
/** The DNA alphabet to use for the logo. */ | ||
alphabet?: UserDefinedAlphabet; | ||
}; | ||
|
||
/** | ||
* Renders a logo with the RNA alphabet, with nucleotides colored similarly to the MEME default. | ||
*/ | ||
export const RNALogo = (props: RNALogoProps) => ( | ||
<Logo alphabet={RNAAlphabet} {...props} /> | ||
); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
import { RNALogo } from "../components/logo/RNALogo"; | ||
import { DataType } from "../types"; | ||
|
||
const meta = { | ||
title: "RNALogo", | ||
component: RNALogo, | ||
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs | ||
tags: ["autodocs"], | ||
parameters: { | ||
// More on how to position stories at: https://storybook.js.org/docs/configure/story-layout | ||
layout: "centered", | ||
}, | ||
} satisfies Meta<typeof RNALogo>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Basic: Story = { | ||
args: { | ||
data: [ | ||
[0.7, 0.1, 0.1, 0.1], | ||
[0, 1, 0, 0], | ||
[0, 0, 0, 1], | ||
[1, 0, 0, 0], | ||
[1, 0, 0, 0], | ||
[0, 1, 0, 0], | ||
[0.3, 0.2, 0.3, 0.2], | ||
], | ||
dataType: DataType.PPM, | ||
width: 700, | ||
}, | ||
}; |