-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds auto-resizing to
<perspective-viewer>
and `<perspective-worksp…
…ace>`
- Loading branch information
Showing
13 changed files
with
172 additions
and
56 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
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
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
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 |
---|---|---|
|
@@ -10,3 +10,4 @@ pub mod monaco; | |
pub mod perspective; | ||
// pub mod perspective_viewer; | ||
pub mod plugin; | ||
pub mod resize_observer; |
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,33 @@ | ||
//////////////////////////////////////////////////////////////////////////////// | ||
// | ||
// Copyright (c) 2018, the Perspective Authors. | ||
// | ||
// This file is part of the Perspective library, distributed under the terms | ||
// of the Apache License 2.0. The full license can be found in the LICENSE | ||
// file. | ||
|
||
// `rustfmt` removes `async` from extern blocks in rust stable | ||
// [issue](https://github.com/rust-lang/rustfmt/issues/4288) | ||
|
||
use wasm_bindgen::prelude::*; | ||
// use web_sys::HtmlElement; | ||
|
||
#[wasm_bindgen(inline_js = "export default ResizeObserver")] | ||
extern "C" { | ||
pub type ResizeObserver; | ||
|
||
#[wasm_bindgen(constructor, js_class = "default")] | ||
pub fn new(callback: &js_sys::Function) -> ResizeObserver; | ||
|
||
#[wasm_bindgen(method)] | ||
pub fn observe(this: &ResizeObserver, elem: &web_sys::HtmlElement); | ||
|
||
#[wasm_bindgen(method)] | ||
pub fn unobserve(this: &ResizeObserver, elem: &web_sys::HtmlElement); | ||
|
||
pub type ResizeObserverEntry; | ||
|
||
#[wasm_bindgen(method, getter, js_name = "contentRect")] | ||
pub fn content_rect(this: &ResizeObserverEntry) -> web_sys::DomRectReadOnly; | ||
|
||
} |
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
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