Giter VIP home page Giter VIP logo

studio's Introduction

@idraw/studio

Version License

idrawjs.com/studio/

Sponsors

@idraw/studio is an MIT-licensed open source project with its ongoing development made possible entirely by the support of these awesome backers. If you'd like to join them, please consider sponsoring iDrawjs's development.

Become a Backer

@idraw/studio Preview

You can click idrawjs.com/studio/ to experience it.

The preview of @idraw/studo.

idraw-studio-light-theme idraw-studio-dark-theme

Usage

# Install peer dependcies
npm install antd idraw

npm install @idraw/studio
import * as React from 'react';
import { createRoot } from 'react-dom/client';
import { Studio } from '@idraw/studio';
import '@idraw/studio/dist/css/index.css'

const App = () => { 
  const [width, setWidth] = useState<number>(window.innerWidth);
  const [height, setHeight] = useState<number>(window.innerHeight);
  useEffect(() => {
    window.addEventListener('resize', () => {
      setWidth(window.innerWidth);
      setHeight(window.innerHeight);
    });
  }, []); 

  return (
    <Studio
      width={width}
      height={height} 
      data={data}
      defaultScaleInfo={{ 
        scale: 1,
        offsetX: 0,
        offsetY: 0
      }}
    />
  );
};

const root = createRoot(document.querySelector('#app'));
root.render(<App />);

Development

git clone [email protected]:idrawjs/studio.git

cd studio

pnpm install

npm run dev

studio's People

Contributors

chenshenhai avatar sunjary avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

studio's Issues

Best way to create a table

If I were to create a table using idraw, would it be better to use html component or create a set of text components? Thank you for suggestions.

export Data file to be loaded in idraw

Hello idraw team, Thank you for the library, currently looks like only image export is possible . How to export the data such that we can download it and load it in a idraw instance.

Thanks in Advance

Todo List

Feature

  • move up/down element
  • drag element to change index
  • html rich-editor
  • dark theme
  • Export result to Image
  • Export result to resource JSON
  • Import data from json by upload
  • Controll scroll bar by keyon keyboard
  • Edit text on screen

Saving and Importing a JSON with pictures.

When you add a picture to a file and download the json the image is being saved as a base64 in the file. When I import the saved json back into the application the image file in there but it is not visible.
Screenshot 2024-01-30 at 7 48 26 AM

idraw.__getOriginContext2D is not a function

菜鸟一个,下载安装后,点界面顶端的下载图片按钮报错:
react-dom.development.js:22839 Uncaught TypeError: idraw.__getOriginContext2D is not a function
at toDataURL (file.js:38:23)
at iDraw.toDataURL (index.js:42:16)
at export-image.tsx:58:23
at export-image.tsx:63:5
at commitHookEffectListMount (react-dom.development.js:23150:26)
at commitPassiveMountOnFiber (react-dom.development.js:24926:13)
at commitPassiveMountEffects_complete (react-dom.development.js:24891:9)
at commitPassiveMountEffects_begin (react-dom.development.js:24878:7)
at commitPassiveMountEffects (react-dom.development.js:24866:3)
at flushPassiveEffectsImpl (react-dom.development.js:27039:3)

图片跨域问题

使用网络图片在改编辑器上进行编辑后,点击保存,会出现导出不了并报错的问题

是否可以增加一个按根节点页面对应呈现的开关或选项呢?

试用studio,现在是下面布局方式,所有左边页面如Home、Sign Up、Sign In等等,都是在一个大页面里聚合显示。因为东西太多,其实都看不太清。要看清楚和真实操作,其实就会放大,本质上就是只显示当前操作的这一个页面。
所以希望可以有个开关,开启时(也许默认可以是开启),点击左侧根节点,右边画布仅展示该对应的页面,感觉操作会便利不少。
image

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.