Skip to content

moved from seamless-immutablility to immer #245

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 67 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
fb72cbf
added ts and vite
yasenytskyoleh Apr 5, 2024
f529b2c
update types
yasenytskyoleh Apr 9, 2024
aef1c19
Merge remote-tracking branch 'origin/feature/typescript'
yasenytskyoleh Apr 10, 2024
a9ceb31
finished update typescript
yasenytskyoleh Apr 11, 2024
8781aa4
Merge remote-tracking branch 'origin/feature/typescript'
yasenytskyoleh Apr 11, 2024
116dba1
extend region classlist prop to array object
yasenytskyoleh Apr 12, 2024
9749868
update tpyse and config
yasenytskyoleh Apr 15, 2024
bc6ae80
Merge remote-tracking branch 'origin/feature/region-classlist'
yasenytskyoleh Apr 15, 2024
b209688
remove dependency with old react
yasenytskyoleh Apr 15, 2024
2feb5cc
Merge remote-tracking branch 'origin/feature/fix-react-instances'
yasenytskyoleh Apr 15, 2024
22124c7
removed dependencis with react v.17 dependency
yasenytskyoleh Apr 16, 2024
28dec45
fixed re-export types
yasenytskyoleh Apr 17, 2024
c2244cc
fixed save action
yasenytskyoleh Apr 17, 2024
f9fa0c3
extend region selector with config allowed actions
yasenytskyoleh Apr 22, 2024
842424c
Merge remote-tracking branch 'origin/feature/extend-region-actions'
yasenytskyoleh Apr 22, 2024
736d78b
fixed package.json
yasenytskyoleh Apr 22, 2024
ce8f0f8
Merge remote-tracking branch 'origin/feature/extend-region-actions'
yasenytskyoleh Apr 22, 2024
dce4729
removed log
yasenytskyoleh Apr 22, 2024
4f4cffe
Merge remote-tracking branch 'origin/feature/extend-region-actions'
yasenytskyoleh Apr 22, 2024
0f66300
fixed broken restore from history, scroll for sidebars
yasenytskyoleh May 2, 2024
d35c761
Merge remote-tracking branch 'origin/feature/broken-history'
yasenytskyoleh May 2, 2024
f563424
updated npm dependencies to fix build
alexschultz Aug 6, 2024
2086fce
refactoring package and customizing to match our use case
alexschultz Aug 6, 2024
7f9245c
added user defined colors to region class list
alexschultz Oct 31, 2024
46ab3ab
updated version
alexschultz Nov 22, 2024
65468b8
added ability to default selected class on load
alexschultz Jan 24, 2025
99a142a
npm version patch
alexschultz Jan 24, 2025
a03a74a
updated to use immer
aman1tagic Apr 9, 2025
d4acf04
package details and dependencies updated
aman1tagic Apr 9, 2025
9f7d8dd
readme updated
aman1tagic Apr 9, 2025
d91c42f
version updated
aman1tagic Apr 9, 2025
65ed18b
removed stories and unwanted images, updated package.json and vite co…
aman1tagic Apr 11, 2025
1220e36
updated username and package
aman1tagic Apr 11, 2025
f564950
updated github
aman1tagic Apr 11, 2025
144127a
updated package version
aman1tagic Apr 11, 2025
9f1de45
updated readme
aman1tagic Apr 11, 2025
12eec93
0.0.3
aman1tagic Apr 11, 2025
7c21db5
added keywords
aman1tagic Apr 11, 2025
0d4bccc
0.0.4
aman1tagic Apr 11, 2025
f6dd343
workspace exports updated
aman1tagic Apr 11, 2025
ad1c668
0.0.5
aman1tagic Apr 11, 2025
2c90514
0.0.6
aman1tagic Apr 11, 2025
0e2475a
image viewer added
aman1tagic Apr 14, 2025
472e85c
0.0.7
aman1tagic Apr 14, 2025
b1918ba
border issue fixed
aman1tagic Apr 15, 2025
a979d62
0.0.8
aman1tagic Apr 15, 2025
4e50dcb
added button click handler ref, to click button from outside
aman1tagic Apr 16, 2025
6aea469
0.0.9
aman1tagic Apr 16, 2025
0346684
interface converted to type
aman1tagic Apr 16, 2025
1eb32a8
0.0.10
aman1tagic Apr 16, 2025
57617fb
0.0.11
aman1tagic Apr 16, 2025
b150027
styled button ref updated
aman1tagic Apr 16, 2025
5d1c62a
workspace modified
aman1tagic Apr 16, 2025
99c1908
0.0.17
aman1tagic Apr 16, 2025
9eaba2a
0.0.18
aman1tagic Apr 16, 2025
a41ed13
workspace fixed
aman1tagic Apr 16, 2025
6d8f65c
0.0.19
aman1tagic Apr 16, 2025
d2c26f6
added regionTag list
aman1tagic Apr 19, 2025
f50c40d
0.0.20
aman1tagic Apr 19, 2025
141051a
removed wasd mode form the image viewer and added custom header item …
aman1tagic Apr 19, 2025
dfa1e7a
removed wasd mode from the image viewer
aman1tagic Apr 19, 2025
d9b24f1
Merge remote-tracking branch 'origin/immer' into immer
aman1tagic Apr 19, 2025
0604330
0.0.21
aman1tagic Apr 19, 2025
5981075
minor fix
aman1tagic Apr 19, 2025
e017bee
0.0.22
aman1tagic Apr 19, 2025
629535c
added icon to custom icon
aman1tagic Apr 19, 2025
41877ae
0.0.23
aman1tagic Apr 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .babelrc

This file was deleted.

2 changes: 0 additions & 2 deletions .flowconfig

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ dist
secret.*
secret.story.*
*.secret.*
.idea
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea
.github
node_modules
src
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"semi": false
"semi": true
}
2 changes: 0 additions & 2 deletions .storybook/addons.js

This file was deleted.

16 changes: 0 additions & 16 deletions .storybook/config.js

This file was deleted.

89 changes: 31 additions & 58 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
# React Image Annotate

[![npm version](https://badge.fury.io/js/react-image-annotate.svg)](https://badge.fury.io/js/react-image-annotate)
[![npm version](https://img.shields.io/npm/v/@asi/react-image-annotate.svg)](https://www.npmjs.com/package/@amnstak/react-image-annotate)

The best image/video annotation tool ever. [Check out the demo here](https://universaldatatool.github.io/react-image-annotate/). Or the [code sandbox here](https://codesandbox.io/s/react-image-annotate-example-38tsc?file=/src/App.js:0-403).
<!-- Fork of react-image-annotate - The best image/video annotation tool
ever. [Check out the demo here](https://codesandbox.io/s/react-image-annotate-example-38tsc?file=/src/App.js:0-403). -->

## Sponsors
Implemented features in fork:

[![wao.ai sponsorship image](https://s3.amazonaws.com/asset.workaround.online/sponsorship-banner-1.png)](https://wao.ai)
- added typescript
- changed seamless immutability to immer
- updated npm and dependencies used by project
- updated react to v.19

## Features

Expand All @@ -20,29 +24,36 @@ The best image/video annotation tool ever. [Check out the demo here](https://uni

## Usage

`npm install react-image-annotate`
`npm i @amnstak/react-image-annotate`

```javascript
import React from "react";
import ReactImageAnnotate from "react-image-annotate";
import Annotator from "@amnstak/react-image-annotate";

const App = () => (
<ReactImageAnnotate
labelImages
regionClsList={["Alpha", "Beta", "Charlie", "Delta"]}
regionTagList={["tag1", "tag2", "tag3"]}
<Annotator
regionClsList={["car", "truck"]}
enabledTools={["select", "create-polygon"]}
selectedTool="select"
images={[
{
src: "https://placekitten.com/408/287",
name: "Image 1",
regions: []
}
src: "https://images.unsplash.com/photo-1561518776-e76a5e48f731?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=750&q=80",
name: "car-image-1",
},
]}
onPrevImages={(state) => {
console.log(state);
}}
onNextImages={(state) => {
console.log(state);
}}
onExit={(output) => {
console.log({output});
}}
/>
);

export default App;

```

To get the proper fonts, make sure to import the Inter UI or Roboto font, the
Expand All @@ -56,46 +67,8 @@ following line added to a css file should suffice.

All of the following properties can be defined on the Annotator...

| Prop | Type (\* = required) | Description | Default |
| ------------------------ | ------------------------------------------------ | --------------------------------------------------------------------------------------- | ------------- |
| `taskDescription` | \*`string` | Markdown description for what to do in the image. | |
| `allowedArea` | `{ x: number, y: number, w: number, h: number }` | Area that is available for annotation. | Entire image. |
| `regionTagList` | `Array<string>` | Allowed "tags" (mutually inclusive classifications) for regions. | |
| `regionClsList` | `Array<string>` | Allowed "classes" (mutually exclusive classifications) for regions. | |
| `imageTagList` | `Array<string>` | Allowed tags for entire image. | |
| `imageClsList` | `Array<string>` | Allowed classes for entire image. | |
| `enabledTools` | `Array<string>` | Tools allowed to be used. e.g. "select", "create-point", "create-box", "create-polygon" | Everything. |
| `showTags` | `boolean` | Show tags and allow tags on regions. | `true` |
| `selectedImage` | `string` | URL of initially selected image. | |
| `images` | `Array<Image>` | Array of images to load into annotator | |
| `showPointDistances` | `boolean` | Show distances between points. | `false` |
| `pointDistancePrecision` | `number` | Precision on displayed points (e.g. 3 => 0.123) | |
| `onExit` | `MainLayoutState => any` | Called when "Save" is called. | |
| `RegionEditLabel` | `Node` | React Node overriding the form to update the region (see [`RegionLabel`](https://github.com/waoai/react-image-annotate/blob/master/src/RegionLabel/index.js)) | |
| `allowComments` | `boolean` | Show a textarea to add comments on each annotation. | `false` |
| `hidePrev` | `boolean` | Hide `Previous Image` button from the header bar. | `false` |
| `hideNext` | `boolean` | Hide `Next Image` button from the header bar. | `false` |
| `hideClone` | `boolean` | Hide `Clone` button from the header bar. | `false` |
| `hideSettings` | `boolean` | Hide `Settings` button from the header bar. | `false` |
| `hideFullScreen` | `boolean` | Hide `FullScreen/Window` button from the header bar. | `false` |
| `hideSave` | `boolean` | Hide `Save` button from the header bar. | `false` |

## Developers

### Development

This project uses [react-storybook](https://storybook.js.org/). To begin developing run the following commands in the cloned repo.

1. `yarn install`
2. `yarn storybook`

A browser tab will automatically open with the project components.

See more details in the [contributing guidelines](https://github.com/waoai/react-image-annotate/wiki/Setup-for-Development).

### Icons

Consult these icon repositories:

- [Material Icons](https://material.io/tools/icons/)
- [Font Awesome Icons](https://fontawesome.com/icons?d=gallery&m=free)
Refer `AnnotatorProps`

`import { AnnotatorProps } from "@amnstak/react-image-annotate";`

It has a complete details of the accepted props
2 changes: 2 additions & 0 deletions public/index.html → index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
Expand Down Expand Up @@ -34,5 +35,6 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
<script type="module" src="/src/index.tsx"></script>
</body>
</html>
Loading