简体   繁体   English

闪亮的自定义滑块

[英]Custom sliders in Shiny

I'm really frustrated by the limited sliders shiny currently provides. 我真的被限制滑块受挫shiny目前提供。 I would like to have a slider that: 我希望有一个滑块:

  1. Has both an inputvalue and a slidervalue that correspond, like the sliders from angularjs : bottom of this link and here 具有相应的输入值和滑块值,例如angularjs的滑块: 此链接的底部和此处
  2. Doesn't refresh the entire every millisecond I try to find to right value. 我尝试找到合适的值时不会每毫秒刷新一次。 I want it to be reactive, but not 25 times when I'm looking for the right value. 我希望它具有反应性,但是当我寻找正确的值时,它不是25次。

Any help is much appreciated. 任何帮助深表感谢。

Edit: Managed to get the AngularJS slider working after the hint below and quite some tries. 编辑:设法使AngularJS滑块在下面的提示和很多尝试之后工作。 Please find the repo here . 请在这里找到仓库。 I although don't manage to get the data back into R. You should do that with the Shiny.onInputChange function. 我虽然没有设法将数据返回到R。您应该使用Shiny.onInputChange函数来实现。 I tried it like this: 我这样尝试过:

        <script language='JavaScript'>          
            var app = angular.module('rzSliderDemo', ['rzModule', 'ui.bootstrap']);
            Shiny.onInputChange("Robject", app);
        app.controller('MainCtrl', function ($scope, $rootScope, $timeout, $modal) {
        //Minimal slider config
        $scope.minSlider = {
        value: 10
    };

});
        </script>

and of course played with the app object name but the slider just keeps failing. 并且当然会使用app对象名称进行播放,但滑块始终会失败。

dreamR的家伙发布了一个可以解决许多缺少的小部件的软件包: https : //github.com/dreamRs/shinyWidgets

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM