Home / File/ mouse-movement.js — react Source File

mouse-movement.js — react Source File

Architecture documentation for mouse-movement.js, a javascript file in the react codebase. 2 imports, 1 dependents.

File javascript BabelCompiler Optimization 2 imports 1 dependents 1 classes

Entity Profile

Dependency Diagram

graph LR
  58fa71f0_b8d1_701b_24d3_36f25df6fe7b["mouse-movement.js"]
  14dde3c9_48ef_6e34_3667_978d06aff15d["TestCase.js"]
  58fa71f0_b8d1_701b_24d3_36f25df6fe7b --> 14dde3c9_48ef_6e34_3667_978d06aff15d
  e1e356f5_b085_dad5_a81f_4b4844381311["TestCase"]
  58fa71f0_b8d1_701b_24d3_36f25df6fe7b --> e1e356f5_b085_dad5_a81f_4b4844381311
  64d54e99_22b8_b387_5b4b_5a0a88626c82["index.js"]
  64d54e99_22b8_b387_5b4b_5a0a88626c82 --> 58fa71f0_b8d1_701b_24d3_36f25df6fe7b
  style 58fa71f0_b8d1_701b_24d3_36f25df6fe7b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import TestCase from '../../TestCase';

const React = window.React;

class MouseMovement extends React.Component {
  state = {
    movement: {x: 0, y: 0},
  };

  onMove = event => {
    this.setState({x: event.movementX, y: event.movementY});
  };

  render() {
    const {x, y} = this.state;

    const boxStyle = {
      padding: '10px 20px',
      border: '1px solid #d9d9d9',
      margin: '10px 0 20px',
    };

    return (
      <TestCase
        title="Mouse Movement"
        description="We polyfill the movementX and movementY fields."
        affectedBrowsers="IE, Safari">
        <TestCase.Steps>
          <li>Mouse over the box below</li>
        </TestCase.Steps>

        <TestCase.ExpectedResult>
          The reported values should equal the pixel (integer) difference
          between mouse movements positions.
        </TestCase.ExpectedResult>

        <div style={boxStyle} onMouseMove={this.onMove}>
          <p>Trace your mouse over this box.</p>
          <p>
            Last movement: {x},{y}
          </p>
        </div>
      </TestCase>
    );
  }
}

export default MouseMovement;

Domain

Subdomains

Classes

Dependencies

Frequently Asked Questions

What does mouse-movement.js do?
mouse-movement.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What does mouse-movement.js depend on?
mouse-movement.js imports 2 module(s): TestCase, TestCase.js.
What files import mouse-movement.js?
mouse-movement.js is imported by 1 file(s): index.js.
Where is mouse-movement.js in the architecture?
mouse-movement.js is located at fixtures/dom/src/components/fixtures/mouse-events/mouse-movement.js (domain: BabelCompiler, subdomain: Optimization, directory: fixtures/dom/src/components/fixtures/mouse-events).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free