<commit_before>title: How to resize and rotate canvas shapes with react and konva?
layout: react_page
---

Currently there is no good pure declarative "react-way" to use Transformer tool.
But you still can use it with some small manual requests to the Konva nodes.
And it will work just fine.

Idea: you need to create `Konva.Transformer` node, and attach it into required node manually.

Instructions: click on shape to select it.

<iframe src="https://codesandbox.io/embed/github/konvajs/site/tree/master/react-demos/transformer?hidenavigation=1&view=split&fontsize=10" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>


<commit_msg>update 2020-11-22<commit_after>title: How to resize and rotate canvas shapes with react and konva?
layout: react_page
---

Currently there is no good, pure declarative "react-way" to use the Transformer tool.
But you can still use it with some small manual requests to the Konva nodes.
And it will work just fine.

The Idea: you need to create a `Konva.Transformer` node, and attach it to the required node manually.

Instructions: Click on one of the shapes to select it.

<iframe src="https://codesandbox.io/embed/github/konvajs/site/tree/master/react-demos/transformer?hidenavigation=1&view=split&fontsize=10" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>



{'fraction_non_alphanumeric': 0.09786130913804278, 'fraction_numerical': 0.019442644199611146, 'mean_word_length': 5.251012145748988, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4916826', 'n_tokens_mistral': 491, 'n_tokens_neox': 458, 'n_words': 170}